Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy operation of DM circuit forgets previous apply_general_kraus operations #203

Open
SUSYUSTC opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@SUSYUSTC
Copy link
Contributor

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]]
@SUSYUSTC SUSYUSTC added the bug Something isn't working label Jan 24, 2024
@refraction-ray
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants