Skip to content

copy operation of DM circuit forgets previous apply_general_kraus operations #203

@SUSYUSTC

Description

@SUSYUSTC

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]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions