Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dumping of backend configuration channels field and update mock backends #5577

Merged
merged 26 commits into from
Mar 25, 2021

Conversation

taalexander
Copy link
Contributor

@taalexander taalexander commented Jan 4, 2021

Summary

Note: These changes are based on the solution introduced in #5570 for #5543 and #5546.

Closes #5579.

This PR adds a field that was not being dumped to the backend configurations.

Details and comments

Mock backends are also updated. Had to modify several tests to pass with new basis gates reported by backends.

@jyu00
Copy link
Contributor

jyu00 commented Jan 4, 2021

@taalexander I opened #5546 to fix the jupyter tools that rely on the old basis gates (although it looks like I missed one test case).

@taalexander
Copy link
Contributor Author

@taalexander I opened #5546 to fix the jupyter tools that rely on the old basis gates (although it looks like I missed one test case).

Great, I'll rebase on this and take your changes.

@taalexander taalexander force-pushed the fix-config-channels-dumping branch from 0b5904e to 62a9c54 Compare January 4, 2021 21:36
@taalexander taalexander changed the title Add dumping of backend configuration channels field Add dumping of backend configuration channels field (Also updates mock backends) Jan 5, 2021
qiskit/dagcircuit/dagcircuit.py Outdated Show resolved Hide resolved
@taalexander taalexander force-pushed the fix-config-channels-dumping branch from 62a9c54 to 6a0aa31 Compare January 7, 2021 22:47
@taalexander taalexander requested a review from kdk January 7, 2021 22:47
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Travis is missing aer, and some tests are failing since BasicAer is u1/u2/u3 only. Can you move the pip install 'qiskit-aer' from L66 to L30 in .travis.yml?

@mtreinish
Copy link
Member

Changes look good. Travis is missing aer, and some tests are failing since BasicAer is u1/u2/u3 only. Can you move the pip install 'qiskit-aer' from L66 to L30 in .travis.yml?

This actually is a different bug we should be skipping in places that require aer when its not installed. We don't install qiskit-aer in all test environments either. Mainly, I don't think the windows CI jobs in azure install aer either. If we can no longer run some fake backends with basic aer after their basis gates are updated we probably need to re-evaluate both: https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/test/mock/fake_backend.py#L120-L144 and the skip condition on the tests that run a circuit on all the fake backends: https://github.com/Qiskit/qiskit-terra/blob/master/test/python/providers/test_fake_backends.py Although it might just be better to add the basis gates to basic aer.

@taalexander taalexander force-pushed the fix-config-channels-dumping branch from 684acd2 to 4aa1bec Compare January 9, 2021 00:43
@taalexander
Copy link
Contributor Author

Changes look good. Travis is missing aer, and some tests are failing since BasicAer is u1/u2/u3 only. Can you move the pip install 'qiskit-aer' from L66 to L30 in .travis.yml?

This actually is a different bug we should be skipping in places that require aer when its not installed. We don't install qiskit-aer in all test environments either. Mainly, I don't think the windows CI jobs in azure install aer either. If we can no longer run some fake backends with basic aer after their basis gates are updated we probably need to re-evaluate both: https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/test/mock/fake_backend.py#L120-L144 and the skip condition on the tests that run a circuit on all the fake backends: https://github.com/Qiskit/qiskit-terra/blob/master/test/python/providers/test_fake_backends.py Although it might just be better to add the basis gates to basic aer.

I'll see if I can add them to basic aer.

@taalexander taalexander force-pushed the fix-config-channels-dumping branch 2 times, most recently from c37891c to c794ad5 Compare January 9, 2021 16:45
@mtreinish
Copy link
Member

mtreinish commented Feb 15, 2021

This is almost ready to merge, there is just one test failing and at least to me there isn't an obvious fix. It looks like the pulse scheduler and the sequencer are producing different results after updating the backend snapshot. For the sequencer it's returning:

actual

without a leading delay. While the expected output based on the pulse scheduler puts a delay before the h gate:

expected

I'm not familiar enough with either code path to have a quick guess as to where it's going wrong there.

@@ -1 +1 @@
{"backend_name": "ibmq_armonk", "backend_version": "1.1.3", "n_qubits": 1, "basis_gates": ["id", "u1", "u2", "u3"], "gates": [{"name": "id", "parameters": [], "qasm_def": "gate id q { U(0,0,0) q; }", "coupling_map": [[0]]}, {"name": "u1", "parameters": ["lambda"], "qasm_def": "gate u1(lambda) q { U(0,0,lambda) q; }", "coupling_map": [[0]]}, {"name": "u2", "parameters": ["phi", "lambda"], "qasm_def": "gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }", "coupling_map": [[0]]}, {"name": "u3", "parameters": ["theta", "phi", "lambda"], "qasm_def": "gate u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }", "coupling_map": [[0]]}], "local": false, "simulator": false, "conditional": false, "open_pulse": true, "memory": true, "max_shots": 8192, "coupling_map": null, "dynamic_reprate_enabled": false, "supported_instructions": ["setf", "measure", "x", "cx", "id", "u2", "shiftf", "acquire", "u1", "delay", "u3", "play"], "max_experiments": 75, "sample_name": "SPARROW", "n_registers": 1, "credits_required": true, "online_date": "2019-10-16T04:00:00+00:00", "description": "1 qubit device", "dt": 0.2222222222222222, "dtm": 0.2222222222222222, "allow_q_object": true, "multi_meas_enabled": false, "parametric_pulses": ["gaussian", "gaussian_square", "drag", "constant"], "quantum_volume": null, "qubit_channel_mapping": [["m0", "d0"]], "uchannels_enabled": true, "url": "None", "allow_object_storage": true, "n_uchannels": 0, "u_channel_lo": [], "meas_levels": [1, 2], "qubit_lo_range": [[4.474446855948306, 5.474446855948306]], "meas_lo_range": [[6.493427855, 7.493427855]], "meas_kernels": ["hw_boxcar"], "discriminators": ["linear_discriminator", "quadratic_discriminator"], "rep_times": [1000.0], "meas_map": [[0]], "acquisition_latency": [], "conditional_latency": [], "hamiltonian": {"description": "Qubits are modeled as Duffing oscillators. In this case, the system includes higher energy states, i.e. not just |0> and |1>. The Pauli operators are generalized via the following set of transformations:\n\n$(\\mathbb{I}-\\sigma_{i}^z)/2 \\rightarrow O_i \\equiv b^\\dagger_{i} b_{i}$,\n\n$\\sigma_{+} \\rightarrow b^\\dagger$,\n\n$\\sigma_{-} \\rightarrow b$,\n\n$\\sigma_{i}^X \\rightarrow b^\\dagger_{i} + b_{i}$.\n\nQubits are coupled through resonator buses. The provided Hamiltonian has been projected into the zero excitation subspace of the resonator buses leading to an effective qubit-qubit flip-flop interaction. The qubit resonance frequencies in the Hamiltonian are the cavity dressed frequencies and not exactly what is returned by the backend defaults, which also includes the dressing due to the qubit-qubit interactions.\n\nQuantities are returned in angular frequencies, with units 2*pi*GHz.\n\nWARNING: Currently not all system Hamiltonian information is available to the public, missing values have been replaced with 0.\n", "h_latex": "\\begin{align} \\mathcal{H}/\\hbar = & \\sum_{i=0}^{0}\\left(\\frac{\\omega_{q,i}}{2}(\\mathbb{I}-\\sigma_i^{z})+\\frac{\\Delta_{i}}{2}(O_i^2-O_i)+\\Omega_{d,i}D_i(t)\\sigma_i^{X}\\right) \\\\ \\end{align}", "h_str": ["_SUM[i,0,0,wq{i}/2*(I{i}-Z{i})]", "_SUM[i,0,0,delta{i}/2*O{i}*O{i}]", "_SUM[i,0,0,-delta{i}/2*O{i}]", "_SUM[i,0,0,omegad{i}*X{i}||D{i}]"], "osc": {}, "qub": {"0": 3}, "vars": {"delta0": -2.189518576306432, "omegad0": 0.0721186503632053, "wq0": 31.25537139664009}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might we send these through a JSON pretty printer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably too much to ask

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really worth it, these are just raw dumps of the api response from the ibmq api they're not meant to be read by humans. We want to preserve the raw formatting because they're only committed to be parsed directly by the fake backends. Any formatting we do will just make the files larger (and they're already quite big)

@kdk kdk added this to the 0.17 milestone Mar 2, 2021
mtreinish pushed a commit to mtreinish/qiskit-core that referenced this pull request Mar 14, 2021
This commit adds the Rz SX and X gates to basic aer simulators basis
gate set. This is necessary for running simulations of the fake backends
which are using the new basis set for the ibmq gates.

This was extracted from Qiskit#5577 which is blocked on other work.
taalexander added a commit that referenced this pull request Mar 15, 2021
* Add additional basis gates rz, sx, x to basicaer.

This commit adds the Rz SX and X gates to basic aer simulators basis
gate set. This is necessary for running simulations of the fake backends
which are using the new basis set for the ibmq gates.

This was extracted from #5577 which is blocked on other work.

* Fix lint and tests

* Add missing error from docstring

Co-authored-by: Thomas Alexander <thomas.a.alexander@ibm.com>
@mtreinish mtreinish changed the title Add dumping of backend configuration channels field (Also updates mock backends) Add dumping of backend configuration channels field and update mock backends Mar 24, 2021
@mergify mergify bot merged commit 5884851 into Qiskit:master Mar 25, 2021
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
…ackends (Qiskit#5577)

* Add support for dumping channels to pulse backend configuration.

* Added reno.

* Fix some tests broken by mock backend updates.

* Correct sequencer test behaviour.

* Update travis install order to install qiskit-aer earlier.

* Update mock backends.

* Add additional basis gates rz, sx, x, with gphase to basicaer.

* Update basicaer to use qiskit gates.

* Fix lint

* Fix some test failures

* Fix lint

* Update mock backends.

* Add mock backends for casablanca, lima, quito and sydney.

* Fix bugs resulting from new calibrations.

* Update api snapshots to latest versions

* Fix test that expected identical behaviour between sequencer and scheduler.

Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
…ackends (Qiskit/qiskit#5577)

* Add support for dumping channels to pulse backend configuration.

* Added reno.

* Fix some tests broken by mock backend updates.

* Correct sequencer test behaviour.

* Update travis install order to install qiskit-aer earlier.

* Update mock backends.

* Add additional basis gates rz, sx, x, with gphase to basicaer.

* Update basicaer to use qiskit gates.

* Fix lint

* Fix some test failures

* Fix lint

* Update mock backends.

* Add mock backends for casablanca, lima, quito and sydney.

* Fix bugs resulting from new calibrations.

* Update api snapshots to latest versions

* Fix test that expected identical behaviour between sequencer and scheduler.

Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock devices have not been updated to match new hardware basis gateset
5 participants