tensorcircuit
tensorcircuit copied to clipboard
`copy` operation of DM circuit forgets previous `apply_general_kraus` operations
copy
operation of DM circuit forgets previous apply_general_kraus
operations.
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())
Error Output
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]]