Skip to content

Commit e3f80c2

Browse files
committed
CuState(CuState) make copy
1 parent bdf8c4f commit e3f80c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/qutip_cuquantum/state.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def __init__(self, arg, hilbert_dims=None, shape=None, copy=True):
4343
shape = arg.shape
4444
if hilbert_dims is not None:
4545
assert arg.base.hilbert_space_dims == hilbert_dims
46+
if copy:
47+
arg = arg.copy()
4648
base = arg.base
4749

4850
elif (CuPyDense is not None and isinstance(arg, CuPyDense)) or isinstance(arg, cp.ndarray):

0 commit comments

Comments
 (0)