-
Notifications
You must be signed in to change notification settings - Fork 12
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
update devices and tests #220
Conversation
tests/backend_test.py
Outdated
@@ -1017,7 +1016,7 @@ def test_compilation_correctness(perth_backend: IBMQBackend) -> None: | |||
c.CX(0, 3).CX(0, 4) | |||
u_backend = AerUnitaryBackend() | |||
u = u_backend.run_circuit(c).get_unitary() | |||
ibm_backend = perth_backend | |||
ibm_backend = AerUnitaryBackend() |
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.
The unitary calculation only works for 14 or less entry's in the coupling map. There are no devices of that size available...
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.
Isn't this test now useless, since it's just comparing AerUnitaryBackend()
with itself? (Also it doesn't need the backend parameter and doesn't need to be a remote-only test.) Can we solve the problem by removing blank wires in the compiled circuit?
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.
remove_blank_wires is still not working, had to use FlattenRelabelRegistersPass
I will now keep the remote backend as it was before?
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.
(done in 25c7929 )
tests/backend_test.py
Outdated
@@ -1086,7 +1085,7 @@ def test_rebase_phase() -> None: | |||
@pytest.mark.skipif(skip_remote_tests, reason=REASON) | |||
def test_postprocess() -> None: | |||
b = IBMQBackend( | |||
"ibm_lagos", | |||
"ibm_kyoto", |
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.
lagos is not in the open plan anymore
return IBMQBackend( | ||
"ibm_perth", |
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.
perth is not in the open plan anymore
48b1f51
to
542a280
Compare
instance="ibm-q/open/main", | ||
token=os.getenv("PYTKET_REMOTE_QISKIT_TOKEN"), | ||
) | ||
assert b.supports_contextual_optimisation | ||
c = Circuit(2, 2) | ||
c.SX(0).SX(1).CX(0, 1).measure_all() | ||
c.X(0).X(1).measure_all() |
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.
CX is not in the target gate set anymore, needed to change the circuit.
@@ -392,29 +392,29 @@ def default_compilation_pass( | |||
if not isinstance(arch, FullyConnected): | |||
if placement_options is not None: | |||
noise_aware_placement = NoiseAwarePlacement( | |||
arch, | |||
arch, # type: ignore |
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.
how about assert(arch is not None)
to get rid of these?
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.
done in 25c7929
tests/backend_test.py
Outdated
@@ -1017,7 +1016,7 @@ def test_compilation_correctness(perth_backend: IBMQBackend) -> None: | |||
c.CX(0, 3).CX(0, 4) | |||
u_backend = AerUnitaryBackend() | |||
u = u_backend.run_circuit(c).get_unitary() | |||
ibm_backend = perth_backend | |||
ibm_backend = AerUnitaryBackend() |
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.
Isn't this test now useless, since it's just comparing AerUnitaryBackend()
with itself? (Also it doesn't need the backend parameter and doesn't need to be a remote-only test.) Can we solve the problem by removing blank wires in the compiled circuit?
tests/backend_test.py
Outdated
@@ -340,17 +340,17 @@ def test_process_characterisation_complete_noise_model() -> None: | |||
assert gqe1[0][1][1][1] == 0.65 | |||
assert gqe1[0][2][1][0] == 0.35 | |||
assert gqe1[0][2][1][1] == 0.65 | |||
assert node_errors[arch.nodes[0]][OpType.U3] == 0.375 | |||
assert round(link_errors[(arch.nodes[0], arch.nodes[1])][OpType.CX], 4) == 0.5625 | |||
assert node_errors[arch.nodes[0]][OpType.U3] == 0.375 # type: ignore |
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.
Use assert again to remove these (and below)?
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.
Done
c1 = cu.circuit | ||
compiled_u = u_backend.run_circuit(c1).get_unitary() | ||
|
||
# Adjust for placement | ||
imap = cu.initial_map | ||
fmap = cu.final_map | ||
c_idx = {c.qubits[i]: i for i in range(7)} | ||
c1_idx = {c1.qubits[i]: i for i in range(7)} | ||
c_idx = {c.qubits[i]: i for i in range(5)} |
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.
Why not 7?
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.
Two qubits are not used and removed by the flatten registers pass. Staying with 7 will create and index out of bounds error.
Some of the backends have been removed, updating the devices requires some changes.