diff --git a/lib_q_computer_math.py b/lib_q_computer_math.py index 6fc170f..80720ef 100644 --- a/lib_q_computer_math.py +++ b/lib_q_computer_math.py @@ -466,9 +466,9 @@ class UnitaryOperator(LinearTransformation, UnitaryMatrix): def __init__(self, m: ListOrNdarray, name: str = '', *args, **kwargs): """UnitaryOperator inherits from both LinearTransformation and a Unitary matrix It is used to act on a State vector by defining the operator to be the dot product""" - self.name = name UnitaryMatrix.__init__(self, m=m, *args, **kwargs) LinearTransformation.__init__(self, m=m, func=self.operator_func, *args, **kwargs) + self.name = name def operator_func(self, other): return State(np.dot(self.m, other.m)) @@ -1137,9 +1137,9 @@ def test_quantum_processor(): qc.add_row([_, x_partial]) qc.print() qp = QuantumProcessor(qc) - qp.get_sample(100) + qp.print_sample(qp.get_sample(100)) if __name__ == "__main__": test() - # test_quantum_processor() + test_quantum_processor()