From 92841df7c9fdb168ca5eddd994286a8506a6f3e6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 27 May 2024 19:56:03 +0800 Subject: [PATCH] Only test qibo backend first --- tests/test_backends.py | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/tests/test_backends.py b/tests/test_backends.py index 501b92c..3fe8fe1 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -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(): @@ -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, +# )