From 6f2eb185c466873475f57d3be5fe43310e53035a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:34:52 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=F0=9F=AA=9D=20update=20p?= =?UTF-8?q?re-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.5) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0) - [github.com/pre-commit/mirrors-prettier: v3.0.3 → v3.1.0](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v3.1.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 095f7b706..b6bdda605 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: # Python linting using ruff - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.5 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -68,7 +68,7 @@ repos: # Check static types with mypy - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.0 hooks: - id: mypy files: ^(src/mqt|test/python) @@ -104,7 +104,7 @@ repos: # Format configuration files with prettier - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v3.1.0 hooks: - id: prettier types_or: [yaml, markdown, html, css, scss, javascript, json] From b2b6411a5bc9ec7fd676afa2daa42eef2ad7cffc Mon Sep 17 00:00:00 2001 From: burgholzer Date: Mon, 13 Nov 2023 11:16:46 -0700 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=A8=20fix=20new=20ruff=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- test/python/test_cliffordsynthesis.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/python/test_cliffordsynthesis.py b/test/python/test_cliffordsynthesis.py index fbb1a15cb..a1c3e969f 100644 --- a/test/python/test_cliffordsynthesis.py +++ b/test/python/test_cliffordsynthesis.py @@ -230,7 +230,7 @@ def bell_circuit() -> QuantumCircuit: def test_optimize_quantum_computation(bell_circuit: QuantumCircuit) -> None: """Test that we can optimize an MQT QuantumComputation.""" qc = qmap.QuantumComputation.from_qiskit(bell_circuit) - circ, results = qmap.optimize_clifford(circuit=qc) + circ, _ = qmap.optimize_clifford(circuit=qc) assert qcec.verify(circ, bell_circuit).considered_equivalent() @@ -238,47 +238,47 @@ def test_optimize_from_qasm_file(bell_circuit: QuantumCircuit) -> None: """Test that we can optimize from a QASM file.""" with Path("bell.qasm").open("w") as f: f.write(bell_circuit.qasm()) - circ, results = qmap.optimize_clifford(circuit="bell.qasm") + circ, _ = qmap.optimize_clifford(circuit="bell.qasm") assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_optimize_qiskit_circuit(bell_circuit: QuantumCircuit) -> None: """Test that we can optimize a Qiskit QuantumCircuit.""" - circ, results = qmap.optimize_clifford(circuit=bell_circuit) + circ, _ = qmap.optimize_clifford(circuit=bell_circuit) assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_optimize_with_initial_tableau(bell_circuit: QuantumCircuit) -> None: """Test that we can optimize a circuit with an initial tableau.""" - circ, results = qmap.optimize_clifford(circuit=bell_circuit, initial_tableau=qmap.Tableau(bell_circuit.num_qubits)) + circ, _ = qmap.optimize_clifford(circuit=bell_circuit, initial_tableau=qmap.Tableau(bell_circuit.num_qubits)) assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_synthesize_from_tableau(bell_circuit: QuantumCircuit) -> None: """Test that we can synthesize a circuit from an MQT Tableau.""" tableau = qmap.Tableau("['XX', 'ZZ']") - circ, results = qmap.synthesize_clifford(target_tableau=tableau) + circ, _ = qmap.synthesize_clifford(target_tableau=tableau) assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_synthesize_from_qiskit_clifford(bell_circuit: QuantumCircuit) -> None: """Test that we can synthesize a circuit from a Qiskit Clifford.""" cliff = Clifford(bell_circuit) - circ, results = qmap.synthesize_clifford(target_tableau=cliff) + circ, _ = qmap.synthesize_clifford(target_tableau=cliff) assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_synthesize_from_qiskit_pauli_list(bell_circuit: QuantumCircuit) -> None: """Test that we can synthesize a circuit from a Qiskit PauliList.""" pauli_list = PauliList(["XX", "ZZ"]) - circ, results = qmap.synthesize_clifford(target_tableau=pauli_list) + circ, _ = qmap.synthesize_clifford(target_tableau=pauli_list) assert qcec.verify(circ, bell_circuit).considered_equivalent() def test_synthesize_from_string(bell_circuit: QuantumCircuit) -> None: """Test that we can synthesize a circuit from a String.""" pauli_str = "[XX,ZZ]" - circ, results = qmap.synthesize_clifford(target_tableau=pauli_str) + circ, _ = qmap.synthesize_clifford(target_tableau=pauli_str) assert qcec.verify(circ, bell_circuit).considered_equivalent()