Skip to content

Commit 3f91404

Browse files
committed
Fix: updates tests
1 parent 034db84 commit 3f91404

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ jobs:
106106
# This is an exact match list, new dependencies will likely require their own entries
107107
run: |
108108
. scripts/ci_install_deps
109-
# poetry run pip-licenses --allow-only="MIT License;Apache Software License;BSD License;GNU Lesser General Public License v2 or later (LGPLv2+);Python Software Foundation License;Apache License 2.0;new BSD;Apache-2.0;ISCL;ISC License (ISCL);BSD;Mozilla Public License 2.0 (MPL 2.0)"
109+
poetry run pip-licenses --allow-only="MIT License;Apache Software License;BSD License;GNU Lesser General Public License v2 or later (LGPLv2+);Python Software Foundation License;Apache License 2.0;new BSD;Apache-2.0;ISCL;ISC License (ISCL);BSD;Mozilla Public License 2.0 (MPL 2.0)"

qiskit_rigetti/_qcs_backend.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ def _prepare_circuit(circuit: QuantumCircuit) -> QuantumCircuit:
8484
"""
8585
Returns a prepared copy of the circuit for execution on the QCS Backend.
8686
"""
87-
if hasattr(circuit, "copy"):
88-
circuit = circuit.copy()
89-
else:
90-
circuit = copy.deepcopy(circuit)
87+
circuit = circuit.copy()
9188
_prepare_readouts(circuit)
9289
return circuit
9390

qiskit_rigetti/_qcs_job.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ def _start_circuit(self, circuit: QuantumCircuit) -> Response:
107107
executable = self._qc.compiler.native_quil_to_executable(program)
108108

109109
# typing: QuantumComputer's inner QAM is generic, so we set the expected type here
110-
result = cast(Response, self._qc.qam.execute(executable))
111-
# store the remote job id here
112-
return result
110+
return cast(Response, self._qc.qam.execute(executable))
113111

114112
@staticmethod
115113
def _handle_barriers(qasm: str, num_circuit_qubits: int) -> str:

tests/test_qcs_backend.py

-4
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,15 @@ def test_run__parametric_circuits(backend: RigettiQCSBackend):
8585
assert result.backend_name == backend.configuration().backend_name
8686
assert len(result.results) == 4
8787

88-
# assert result.results[0].header.name.startswith(f"{circuit1.name}-")
8988
assert result.results[0].shots == 1000
9089
assert result.get_counts(0).keys() == {"0", "1"}
9190

92-
# assert result.results[1].header.name.startswith(f"{circuit1.name}-")
9391
assert result.results[1].shots == 1000
9492
assert result.get_counts(1).keys() == {"0", "1"}
9593

96-
# assert result.results[2].header.name.startswith(f"{circuit2.name}-")
9794
assert result.results[2].shots == 1000
9895
assert result.get_counts(2).keys() == {"0", "1"}
9996

100-
# assert result.results[3].header.name.startswith(f"{circuit2.name}-")
10197
assert result.results[3].shots == 1000
10298
assert result.get_counts(3).keys() == {"0", "1"}
10399

tests/test_qcs_provider.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ def test_get_simulator(monkeypatch):
2525

2626
assert backend.name() == "42q-qvm"
2727
assert backend.configuration().num_qubits == 42
28+
# The default QVM url is 127.0.0.1, but Gitlab CI may use a docker service url.
29+
# Below we assert that the local value on the configuration is True/False depending
30+
# on the `QCS_SETTINGS_APPLICATIONS_PYQUIL_QVM_URL` set during the test run.
2831
assert (
29-
"qvm:" not in os.getenv("QCS_SETTINGS_APPLICATIONS_PYQUIL_QVM_URL", "127.0.0.1")
32+
"http://qvm:5000" != os.getenv("QCS_SETTINGS_APPLICATIONS_PYQUIL_QVM_URL", "http://127.0.0.1:5000")
3033
) == backend.configuration().local
3134
assert backend.configuration().simulator
3235
assert backend.configuration().coupling_map

0 commit comments

Comments
 (0)