Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Guy Puts committed Oct 24, 2024
1 parent 0a54d27 commit da830ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
31 changes: 7 additions & 24 deletions test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ def test_hectoqubit_backend() -> None:
):
qc.export(fmt=ExportFormat.QUANTIFY_SCHEDULER)
else:
exported_schedule, bit_string_mapping = qc.export(
fmt=ExportFormat.QUANTIFY_SCHEDULER
)
exported_schedule, bit_string_mapping = qc.export(fmt=ExportFormat.QUANTIFY_SCHEDULER)

assert exported_schedule.name == "Exported OpenSquirrel circuit"

Expand Down Expand Up @@ -187,21 +185,15 @@ def test_hectoqubit_backend() -> None:
"Measure q[1]",
]

ir_measures = [
instruction
for instruction in qc.ir.statements
if isinstance(instruction, Measure)
]
ir_measures = [instruction for instruction in qc.ir.statements if isinstance(instruction, Measure)]
qs_measures = [
operation.data["gate_info"]
for operation in exported_schedule.operations.values()
if operation.data["gate_info"]["operation_type"] == "measure"
]

ir_acq_index_record = [0] * qc.qubit_register_size
ir_bit_string_mapping: list[tuple[None, None] | tuple[int, int]] = [
(None, None)
] * qc.bit_register_size
ir_bit_string_mapping: list[tuple[None, None] | tuple[int, int]] = [(None, None)] * qc.bit_register_size
for i, ir_measure in enumerate(ir_measures):
qubit_index = ir_measure.qubit.index
ir_acq_index = ir_acq_index_record[qubit_index]
Expand Down Expand Up @@ -266,14 +258,11 @@ def test_hectoqubit_backend_allxy() -> None:
if importlib.util.find_spec("quantify_scheduler") is None:
with pytest.raises(
Exception,
match="quantify-scheduler is not installed, or cannot be installed on "
"your system",
match="quantify-scheduler is not installed, or cannot be installed on " "your system",
):
qc.export(fmt=ExportFormat.QUANTIFY_SCHEDULER)
else:
exported_schedule, bit_string_mapping = qc.export(
fmt=ExportFormat.QUANTIFY_SCHEDULER
)
exported_schedule, bit_string_mapping = qc.export(fmt=ExportFormat.QUANTIFY_SCHEDULER)

assert exported_schedule.name == "Exported OpenSquirrel circuit"

Expand Down Expand Up @@ -320,16 +309,10 @@ def test_hectoqubit_backend_allxy() -> None:
if operation.data["gate_info"]["operation_type"] == "measure"
]

ir_measures = [
instruction
for instruction in qc.ir.statements
if isinstance(instruction, Measure)
]
ir_measures = [instruction for instruction in qc.ir.statements if isinstance(instruction, Measure)]

ir_acq_index_record = [0] * qc.qubit_register_size
ir_bit_string_mapping: list[tuple[None, None] | tuple[int, int]] = [
(None, None)
] * qc.bit_register_size
ir_bit_string_mapping: list[tuple[None, None] | tuple[int, int]] = [(None, None)] * qc.bit_register_size
for i, ir_measurement in enumerate(ir_measures):
qubit_index = ir_measurement.qubit.index
ir_acq_index = ir_acq_index_record[qubit_index]
Expand Down
1 change: 0 additions & 1 deletion test/test_replacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_wrong_qubit(self, gate: Gate, replacement_gates: list[Gate], error_msg:
with pytest.raises(ValueError, match=error_msg):
check_gate_replacement(gate, replacement_gates)


def test_large_number_of_qubits(self) -> None:
# If we were building the whole circuit matrix, this would run out of memory.
check_gate_replacement(H(9234687), [Y90(9234687), X(9234687)])
Expand Down

0 comments on commit da830ac

Please sign in to comment.