Skip to content

Commit

Permalink
Only test qibo backend first
Browse files Browse the repository at this point in the history
  • Loading branch information
mho291 committed May 27, 2024
1 parent 6729b0b commit 92841df
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
QIBO_TK = os.environ.get("QIBO_CLIENT_TII_TOKEN")


def test_qiskit_client_backend():
c = random_clifford(3, backend=NP_BACKEND)
c.add(gates.M(0, 2))
client = QiskitClientBackend(
token=QISKIT_TK, provider="ibm-q", platform="ibmq_qasm_simulator"
)
local_res = NP_BACKEND.execute_circuit(c)
remote_res = client.execute_circuit(c)
NP_BACKEND.assert_allclose(
local_res.probabilities(qubits=[0, 2]), remote_res.probabilities(), atol=1e-1
)
# def test_qiskit_client_backend():
# c = random_clifford(3, backend=NP_BACKEND)
# c.add(gates.M(0, 2))
# client = QiskitClientBackend(
# token=QISKIT_TK, provider="ibm-q", platform="ibmq_qasm_simulator"
# )
# local_res = NP_BACKEND.execute_circuit(c)
# remote_res = client.execute_circuit(c)
# NP_BACKEND.assert_allclose(
# local_res.probabilities(qubits=[0, 2]), remote_res.probabilities(), atol=1e-1
# )


def test_qibo_client_backend():
Expand All @@ -35,3 +35,22 @@ def test_qibo_client_backend():
remote_res.probabilities(qubits=[0, 2]),
atol=1e-1,
)

# def test_aws_client_backend():
# circuit_qibo = random_clifford(3, backend=NP_BACKEND)
# circuit_qibo.add(gates.M(0, 2))
#
# # Local simulator test, does not cost money
# client = aws_client.BraketClientBackend()
# # AWS device tests, cost money
# # AWS = aws_client.BraketClientBackend(device = AwsDevice("arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"))
# # AWS = aws_client.BraketClientBackend(device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1"))
#
# local_res = NP_BACKEND.execute_circuit(circuit_qibo)
# remote_res = client.execute_circuit(circuit_qibo)
#
# NP_BACKEND.assert_allclose(
# local_res.probabilities(qubits=[0, 2]),
# remote_res.probabilities(qubits=[0, 2]),
# atol=1e-1,
# )

0 comments on commit 92841df

Please sign in to comment.