-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add dumping of backend configuration channels field and update mock backends #5577
Conversation
2b9ec11
to
d06d6a7
Compare
@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. |
0b5904e
to
62a9c54
Compare
62a9c54
to
6a0aa31
Compare
There was a problem hiding this 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?
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. |
684acd2
to
4aa1bec
Compare
I'll see if I can add them to basic aer. |
c37891c
to
c794ad5
Compare
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: without a leading delay. While the expected output based on the pulse scheduler puts a delay before the h gate: 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}}} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
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.
* 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>
…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>
…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>
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.