Skip to content

Commit

Permalink
some types fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Antonioli committed Nov 25, 2023
1 parent 283b78d commit 4fa3ce0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/qimp/Filters/Gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def make_translation(
return controlled_translation


def encode_number(quantumImage: qimp.ImageEncoding.QuantumImage.QuantumImage, shift: bool) -> None:
def encode_number(quantumImage: qimp.ImageEncoding.QuantumImage.QuantumImage, shift: int) -> None:
"""Encode number in binary with x gates."""
number = format(shift, "0" + str(quantumImage.num_summing) + "b")
for index, element in enumerate(number[::-1]):
Expand Down
17 changes: 9 additions & 8 deletions src/qimp/ImageEncoding/QuantumImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,24 @@ def test_image(side: int = 8) -> numpy.ndarray:
class QuantumImage(object):
"""General class to implement represent a classical image in Qiskit."""

angles = []
angles: list[float] = list()
circuit = QuantumCircuit()
x_qubits = QuantumRegister()
y_qubits = QuantumRegister()
color_qubit = QuantumRegister()
total_qubits = 0
initial_qubits = 0
x_wires = []
y_wires = []
c_wire = []
pos_wires = []
total_wires = list
x_wires: list[int] = []
y_wires: list[int] = []
c_wire: list[int] = []
pos_wires: list[int] = []
total_wires: list[int] = list
n_aux_qubit = 0
encoding = str
num_carry = 0
num_summing = 0
circuit = QuantumCircuit()
image = np.ndarray

def __init__(self, image: numpy.ndarray, zooming_factor: int = 1) -> None:
"""
Expand Down Expand Up @@ -153,7 +154,7 @@ def draw_circuit(self) -> None:
self.circuit.draw(output="mpl")
plt.show()

def insert_qubits(self, n: int, name: str = None) -> None:
def insert_qubits(self, n: int, name: str = "") -> None:
"""Insert qubits in the image circuit.
Args:
Expand All @@ -167,7 +168,7 @@ def insert_qubits(self, n: int, name: str = None) -> None:
self.circuit.regs.insert(0, qr1)
# TODO: Modify for insertion on top

def add_qubits(self, n: int, name: str = None) -> None:
def add_qubits(self, n: int, name: str = "") -> None:
"""Append qubits.
Args:
Expand Down

0 comments on commit 4fa3ce0

Please sign in to comment.