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

Incompatibilities with qiskit-aer 0.13.0 #1292

Closed
wshanks opened this issue Oct 27, 2023 · 1 comment
Closed

Incompatibilities with qiskit-aer 0.13.0 #1292

wshanks opened this issue Oct 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@wshanks
Copy link
Collaborator

wshanks commented Oct 27, 2023

Several of the qiskit-experiments tests fail when using qiskit-aer 0.13.0. This issue is for tracking them all together. Individual issues could be created if necessary.

Currently, there are three unique failure cases:

  1. StandardRB can not handle a BackendV2 without a coupling map (AerSimulator was converted to BackendV2 in 0.13.0):
======================================================================
FAIL: test.library.randomized_benchmarking.test_standard_rb.TestRunStandardRB.test_two_qubit
----------------------------------------------------------------------
...
  File "/qiskit-experiments/qiskit_experiments/library/randomized_benchmarking/standard_rb.py", line 244, in is_bidirectional
    return len(coupling_map.reduce(self.physical_qubits).get_edges()) == 2
               ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'reduce'

#1293 has a suggested solution for this one.

  1. reset is not in the AerSimulator equivalence library:
======================================================================
FAIL: test.library.tomography.test_state_tomography.TestStateTomography.test_mitigated_full_qst_8__0__3__1_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
----------------------------------------------------------------------                                                                                         
  File "/qiskit-experiments/qiskit_experiments/framework/base_experiment.py", line 370, in _transpiled_circuits
    transpiled = transpile(self.circuits(), self.backend, **transpile_opts)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
  File "/qiskit-terra/qiskit/transpiler/passes/basis/unroll_custom_definitions.py", line 97, in run
    raise QiskitError(                                                  
qiskit.exceptions.QiskitError: "Cannot unroll the circuit to the given basis, dict_keys(['measure', 'for_loop', 'sx', 'set_matrix_product_state', 'set_superop', 'save_stabilizer', 'save_state', 'save_amplitudes', 'save_clifford', 'if_else', 'cx', 'set_density_matrix', 'roerror', 'save_probabilities_dict', 'save_state
vector', 'save_statevector_dict', 'save_amplitudes_sq', 'superop', 'save_matrix_product_state', 'save_expval_var', 'rz', 'kraus', 'id', 'save_expval', 'save_unitary', 'set_stabilizer', 'set_unitary', 'save_superop', 'save_density_matrix', 'while_loop', 'set_statevector', 'save_probabilities', 'qerror_loc', 'continue_
loop', 'quantum_channel', 'break_loop']). Instruction reset not found in equivalence library and no rule found to expand."
"""                                                                                         

I opened Qiskit/qiskit-aer#1975 regarding this. #1294 has a work around for this.

  1. Variance of RB result does not decrease with extra circuits.
======================================================================                                                                                         
FAIL: test.library.randomized_benchmarking.test_standard_rb.TestRunStandardRB.test_add_more_circuit_yields_lower_variance                                      
tags: worker-0                                                                                                                                                                                                                                                                                                                
----------------------------------------------------------------------                                                                                                                                                                                                                                                        
Traceback (most recent call last):                                                                                                                             
  File "/qiskit-experiments/test/library/randomized_benchmarking/test_standard_rb.py", line 346, in test_add_more_circuit_yields_lower_variance
    self.assertLess(
  File "/envs/qiskit-experiments/lib/python3.11/unittest/case.py", line 1259, in assertLess
    self.fail(self._formatMessage(msg, standardMsg))
  File "/envs/qiskit-experiments/lib/python3.11/unittest/case.py", line 703, in fail
    raise self.failureException(msg)
AssertionError: 0.004765809096054359 not less than 0.003841173938210405

#1295 has a fix for this. In this case, I think the test just did have statistically robust enough for the comparison it was trying to make and an incidental change in Aer (something equivalent to changing the random seed) caused the test start simulating numbers that did not meet its expectation. #1295 tries to make the numbers more robust.

@wshanks wshanks added the bug Something isn't working label Oct 27, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 30, 2023
`StandardRB` handles directed two-qubit gates differently from
bi-directional ones. For `BackendV2`, it used the `coupling_map` to
check for directionality but did not handle the case where the coupling
map was `None` which implies all to all connectivity. With this change,
`StandardRB` treats gates with no coupling map as bidirectional.

This issue first surfaced with qiskit-aer 0.13.0 which made
`AerSimulator` a `BackendV2` backend
(#1292).
mergify bot pushed a commit that referenced this issue Oct 30, 2023
`StandardRB` handles directed two-qubit gates differently from
bi-directional ones. For `BackendV2`, it used the `coupling_map` to
check for directionality but did not handle the case where the coupling
map was `None` which implies all to all connectivity. With this change,
`StandardRB` treats gates with no coupling map as bidirectional.

This issue first surfaced with qiskit-aer 0.13.0 which made
`AerSimulator` a `BackendV2` backend
(#1292).

(cherry picked from commit a34df8c)
wshanks pushed a commit that referenced this issue Oct 31, 2023
…ort #1293) (#1298)

This is an automatic backport of pull request #1293 done by
[Mergify](https://mergify.com).

---

`StandardRB` handles directed two-qubit gates differently from
bi-directional ones. For `BackendV2`, it used the `coupling_map` to
check for directionality but did not handle the case where the coupling
map was `None` which implies all to all connectivity. With this change,
`StandardRB` treats gates with no coupling map as bidirectional.

This issue first surfaced with qiskit-aer 0.13.0 which made
`AerSimulator` a `BackendV2` backend
(#1292).
@wshanks
Copy link
Collaborator Author

wshanks commented Nov 13, 2023

Closed by #1293 #1294 #1295

@wshanks wshanks closed this as completed Nov 13, 2023
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this issue Jan 17, 2024
…t-community#1293)

`StandardRB` handles directed two-qubit gates differently from
bi-directional ones. For `BackendV2`, it used the `coupling_map` to
check for directionality but did not handle the case where the coupling
map was `None` which implies all to all connectivity. With this change,
`StandardRB` treats gates with no coupling map as bidirectional.

This issue first surfaced with qiskit-aer 0.13.0 which made
`AerSimulator` a `BackendV2` backend
(qiskit-community#1292).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant