Skip to content

Commit

Permalink
Merge pull request #76 from QCpython/refactor/remove-unused-imports
Browse files Browse the repository at this point in the history
Remove Unused Imports
  • Loading branch information
brennanfreeze authored Sep 15, 2024
2 parents 0b2b635 + a1825d1 commit 6166733
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/quantum_circuit/quantum_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(

elif self.gpu:
try:
check = subprocess.check_output(["nvcc", "--version"]).decode()
subprocess.check_output(["nvcc", "--version"]).decode()
self.calculator = GpuCalculator(qubits, big_endian, prep)
except FileNotFoundError:
print("ERROR: CUDA NOT INSTALLED. SWITCHING TO BASE...")
Expand Down
1 change: 0 additions & 1 deletion src/tools/amplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 1 addition & 2 deletions src/visualize/q_sphere.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
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 ..tools import probability, phaseangle


def hamming_distance(l1: str, l2: str):
Expand Down
1 change: 0 additions & 1 deletion src/visualize/state_vector.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6166733

Please sign in to comment.