From 00274ae217176088c984bca8ca112a5c6c6d086b Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Tue, 4 Feb 2020 16:16:26 +0100 Subject: [PATCH] fix unitary operator repr --- lib_q_computer_math.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()