Closed 1ucian0 closed 5 days ago
One or more of the following people are relevant to this code:
@Qiskit/terra-core
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/expr.rs | 1 | 94.02% | ||
crates/qasm2/src/lex.rs | 4 | 92.62% | ||
crates/qasm2/src/parse.rs | 18 | 96.69% | ||
<!-- | Total: | 23 | --> |
Totals | |
---|---|
Change from base Build 9650973845: | -0.03% |
Covered Lines: | 63758 |
Relevant Lines: | 71056 |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/expr.rs | 1 | 94.02% | ||
crates/qasm2/src/lex.rs | 6 | 91.6% | ||
<!-- | Total: | 7 | --> |
Totals | |
---|---|
Change from base Build 9661630219: | 0.01% |
Covered Lines: | 63760 |
Relevant Lines: | 71056 |
am I allowed to approve?
It seems you are.
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/expr.rs | 1 | 94.02% | ||
crates/qasm2/src/lex.rs | 4 | 92.37% | ||
<!-- | Total: | 5 | --> |
Totals | |
---|---|
Change from base Build 9661630219: | 0.01% |
Covered Lines: | 63759 |
Relevant Lines: | 71056 |
I think we need to add an internal path for building a target for 1 qubit, because GenericBackendV2
contains 2q basis gates by default (that's why the test fails currently).
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/lex.rs | 6 | 92.62% | ||
<!-- | Total: | 6 | --> |
Totals | |
---|---|
Change from base Build 9661630219: | 0.03% |
Covered Lines: | 63771 |
Relevant Lines: | 71056 |
I think we need to add an internal path for building a target for 1 qubit, because
GenericBackendV2
contains 2q basis gates by default (that's why the test fails currently).
I think I prefer to keep the default simple (without different values depending on the number of qubits) and be explicit on the basis _gate
(see https://github.com/Qiskit/qiskit/pull/12653/commits/43a94f1d79f72c482a38820ddef63df85836a0d0). What do you think?
I think that can work too. If we see this is causing problems we can always correct the 1q path.
@Mergifyio backport stable/0.46 stable/1.1
backport stable/0.46 stable/1.1
Summary
GenericBackendV2 should not accept backends that are too small for certain gates. The following examples should be rejected:
GenericBackendV2(num_qubits=1, basis_gates=["cx", "id"])
GenericBackendV2(num_qubits=2, basis_gates=["ccx", "id"])
@ElePT found this!