diff --git a/quantum/qauntum_logic_gates.py b/quantum/qauntum_logic_gates.py index b4e3c93b4..b3f5c0ef4 100644 --- a/quantum/qauntum_logic_gates.py +++ b/quantum/qauntum_logic_gates.py @@ -27,7 +27,7 @@ def paulix_gate(input_realvalue: float, input_imaginaryvalue: float) -> list[flo Usage : >>> paulix_gate(2,3) - array([3 2]) + array([3, 2]) """ paulix_matrix = np.array([[0, 1], [1, 0]]) complex_input = np.array([input_realvalue, input_imaginaryvalue]) @@ -46,7 +46,7 @@ def pauliy_gate(input_realvalue: float, input_imaginaryvalue: float) -> list[flo Usage : >>> pauliy_gate(5,8) - array([0.+8.j 0.-5.j]) + array([0.+8.j, 0.-5.j]) """ i = complex(0, 1) pauliy_matrix = [[0, i], [-1 * i, 0]] @@ -66,7 +66,7 @@ def pauliz_gate(input_realvalue: float, input_imaginaryvalue: float) -> list[flo Usage : >>> pauliz_gate(4,1) - array([ 4 -1]) + array([ 4, -1]) """ pauliz_matrix = np.array([[1, 0], [0, -1]]) complex_input = np.array([input_realvalue, input_imaginaryvalue]) @@ -108,7 +108,7 @@ def phasefactor_of_input( Usage : >>> phasefactor_of_input(4,7,45) - array([1.39737084e+20+0.j 2.44539897e+20+0.j]) + array([1.39737084e+20+0.j, 2.44539897e+20+0.j]) """ iota = cmath.exp(alpha) phasefactor = [[iota, 0], [0, iota]] @@ -132,7 +132,7 @@ def phaseshift_of_input( Usage : >>> phaseshift_of_input(3,9,30) - array([3.00000000e+00+0.j 9.61782712e+13+0.j]) + array([3.00000000e+00+0.j, 9.61782712e+13+0.j]) """ iota = cmath.exp(alpha) phase = [[1, 0], [0, iota]] @@ -152,8 +152,7 @@ def hadamard_gate(input_realvalue: float, input_imaginaryvalue: float) -> list[f Usage : >>> hadamard_gate(5,9) - array([ 9.89949494 -2.82842712] - [1.+0.j 0.+0.j 0.+0.j 7.+0.j]) + array([ 9.89949494, -2.82842712]) """ root_of_2 = 1.0 / math.sqrt(2) hadamard_gate_matrix = np.array( @@ -180,7 +179,7 @@ def controlled_not_gate_in_0ket( Usage : >>> controlled_not_gate_in_0ket(1,7,4,8) - array([7 1 4 8]) + array([7, 1, 4, 8]) """ controlled_not_gate_0ket_matrix = np.array( [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] @@ -214,7 +213,7 @@ def controlled_not_gate( Usage : >>> controlled_not_gate(6,3,7,5) - array([6 3 5 7]) + array([6, 3, 5, 7]) """ controlled_not_gate_matrix = np.array( [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] @@ -247,7 +246,7 @@ def inverted_controlled_not_gate( Usage : >>> inverted_controlled_not_gate(8,4,9,6) - array([8 6 9 4]) + array([8, 6, 9, 4]) """ inverted_controlled_not_gate_matrix = np.array( [[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]] @@ -283,7 +282,8 @@ def controlled_phase_multiplication( Usage : >>> controlled_phase_multiplication(3,2,5,1,10) - array([3.00000000e+00+0.j 2.00000000e+00+0.j 1.10132329e+05+0.j + array([3.00000000e+00+0.j, 2.00000000e+00+0.j, + 1.10132329e+05+0.j, 2.20264658e+04+0.j]) """ iota = cmath.exp(alpha) @@ -318,7 +318,7 @@ def swap_gate( Usage : >>> swap_gate(5,1,3,7) - array([5 3 1 7]) + array([5, 3, 1, 7]) """ swap_gate_matrix = np.array( [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]] @@ -356,7 +356,7 @@ def spin_of_input( Usage : >>> spin_of_input(6,3,45,1,8,3) - array([-16.93201614+10.23066476j -50.61991392 -1.46152354j]) + array([-16.93201614+10.23066476j, -50.61991392 -1.46152354j]) """ i = complex(0, 1) spin_matrix = [