Open SUSYUSTC opened 5 months ago
copy operation of DM circuit forgets previous apply_general_kraus operations.
copy
apply_general_kraus
n = 1 c = tc.DMCircuit(n) c.h(0) P0 = np.array([[1.0, 0.0], [0.0, 0.0]]) P1 = np.array([[0.0, 0.0], [0.0, 1.0]]) c.apply_general_kraus([P0, P1], 0) print('without copy') print(c.densitymatrix()) print('with copy') print(c.copy().densitymatrix())
without copy [[0.5+0.j 0. +0.j] [0. +0.j 0.5+0.j]] with copy [[0.5+0.j 0.5+0.j] [0.5+0.j 0.5+0.j]]
Indeed, copy only copy the operations recorded on the c._qir, since channel operations is now not recorded on qir, these channels cannot move the the copied circuit
c._qir
qir
copy
operation of DM circuit forgets previousapply_general_kraus
operations.Error Output