From c17bbdc850725dfd0fa4b3ccebfc90fe99d49234 Mon Sep 17 00:00:00 2001 From: paris osuch Date: Fri, 13 Sep 2024 22:35:40 -0700 Subject: [PATCH 1/6] remove unused variable --- src/quantum_circuit/quantum_circuit.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/quantum_circuit/quantum_circuit.py b/src/quantum_circuit/quantum_circuit.py index def53f1..8a9188f 100644 --- a/src/quantum_circuit/quantum_circuit.py +++ b/src/quantum_circuit/quantum_circuit.py @@ -36,7 +36,6 @@ def __init__( elif self.gpu: try: - check = subprocess.check_output(["nvcc", "--version"]).decode() self.calculator = GpuCalculator(qubits, big_endian, prep) except FileNotFoundError: print("ERROR: CUDA NOT INSTALLED. SWITCHING TO BASE...") From f57d12932e73e5d94c10a9fe12184ebcc1a4fd15 Mon Sep 17 00:00:00 2001 From: paris osuch Date: Fri, 13 Sep 2024 22:41:35 -0700 Subject: [PATCH 2/6] remove unused variable --- src/tools/amplitude.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/amplitude.py b/src/tools/amplitude.py index aeb10b2..b502f21 100644 --- a/src/tools/amplitude.py +++ b/src/tools/amplitude.py @@ -5,7 +5,6 @@ def amplitude(quantumstate, show_bit=-1, round: int = 3, radian: bool = False): quantumstate = convert_state(quantumstate) - size = int(log2(quantumstate.size)) ToolsException().test_amplitude(show_bit, round, amplitude) if isinstance(show_bit, int) and show_bit < 0: amplitude = sqrt(power(quantumstate.real, 2) + power(quantumstate.imag, 2)) From 50467de2c7fcadbaa70543101cbde18b23b6707a Mon Sep 17 00:00:00 2001 From: paris osuch Date: Fri, 13 Sep 2024 22:43:12 -0700 Subject: [PATCH 3/6] remove unused import --- src/visualize/q_sphere.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/visualize/q_sphere.py b/src/visualize/q_sphere.py index 8a0377b..e0c0aeb 100644 --- a/src/visualize/q_sphere.py +++ b/src/visualize/q_sphere.py @@ -1,7 +1,6 @@ from collections import deque import matplotlib.pyplot as plt import numpy as np -from matplotlib.cm import ScalarMappable from .base.sphere import sphere from ..tools import probability, amplitude, phaseangle From c902a85e2c48bc8f98f3bc5bec4729628173ab96 Mon Sep 17 00:00:00 2001 From: paris osuch Date: Fri, 13 Sep 2024 22:44:45 -0700 Subject: [PATCH 4/6] remove unused import --- src/visualize/q_sphere.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visualize/q_sphere.py b/src/visualize/q_sphere.py index e0c0aeb..16a4137 100644 --- a/src/visualize/q_sphere.py +++ b/src/visualize/q_sphere.py @@ -2,7 +2,7 @@ import matplotlib.pyplot as plt import numpy as np from .base.sphere import sphere -from ..tools import probability, amplitude, phaseangle +from ..tools import probability, phaseangle def hamming_distance(l1: str, l2: str): From 9f856e4914bbc006131b980f44a382bab3b79eb2 Mon Sep 17 00:00:00 2001 From: paris osuch Date: Fri, 13 Sep 2024 22:45:17 -0700 Subject: [PATCH 5/6] remove unused import --- src/visualize/state_vector.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/visualize/state_vector.py b/src/visualize/state_vector.py index 1451600..f5db798 100644 --- a/src/visualize/state_vector.py +++ b/src/visualize/state_vector.py @@ -1,6 +1,5 @@ import matplotlib.pyplot as plt import numpy as np -from matplotlib.cm import ScalarMappable from matplotlib.colors import rgb2hex from .base.graph import graph from ..tools import amplitude, phaseangle From a1825d126efceb7876833bc6fa1696a46f32f92e Mon Sep 17 00:00:00 2001 From: paris osuch Date: Sun, 15 Sep 2024 10:49:43 -0700 Subject: [PATCH 6/6] call function without variable assignment --- src/quantum_circuit/quantum_circuit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/quantum_circuit/quantum_circuit.py b/src/quantum_circuit/quantum_circuit.py index 8a9188f..b819377 100644 --- a/src/quantum_circuit/quantum_circuit.py +++ b/src/quantum_circuit/quantum_circuit.py @@ -36,6 +36,7 @@ def __init__( elif self.gpu: try: + subprocess.check_output(["nvcc", "--version"]).decode() self.calculator = GpuCalculator(qubits, big_endian, prep) except FileNotFoundError: print("ERROR: CUDA NOT INSTALLED. SWITCHING TO BASE...")