From 634634926601329145393238670b878231d594ca Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Tue, 22 Apr 2025 16:13:22 +0300 Subject: [PATCH] chore: remove .python-version file --- .gitignore | 2 +- .python-version | 1 - src/grovers_visualizer/gates.py | 10 ++++------ 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 .python-version diff --git a/.gitignore b/.gitignore index 280bbee..d3366de 100644 --- a/.gitignore +++ b/.gitignore @@ -90,7 +90,7 @@ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# .python-version +.python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. diff --git a/.python-version b/.python-version deleted file mode 100644 index 24ee5b1..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.13 diff --git a/src/grovers_visualizer/gates.py b/src/grovers_visualizer/gates.py index 531ad3c..a23442c 100644 --- a/src/grovers_visualizer/gates.py +++ b/src/grovers_visualizer/gates.py @@ -14,9 +14,7 @@ def apply_phase_inversion(qc: QuantumCircuit, n: int) -> None: """Apply a multi-controlled phase inversion (Z) to the marked state.""" if n == 1: qc.z(0) - elif n == 2: - qc.cz(0, 1) - else: - qc.h(n - 1) - qc.mcx(list(range(n - 1)), n - 1) # multi-controlled X (Toffoli for 3 qubits) - qc.h(n - 1) + return + qc.h(n - 1) + qc.mcx(list(range(n - 1)), n - 1) + qc.h(n - 1)