Skip to content

Commit 29ec79b

Browse files
committed
adapt quantum-gates notebook for v5
1 parent d3bfcf5 commit 29ec79b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials-v5/quantum-circuits/quantum-gates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ From QuTiP 4.4 on, user defined gates can be defined by a python function that t
418418
```python
419419
def user_gate1(arg_value):
420420
# controlled rotation X
421-
mat = np.zeros((4, 4), dtype=np.complex)
421+
mat = np.zeros((4, 4), dtype=complex)
422422
mat[0, 0] = mat[1, 1] = 1.0
423-
mat[2:4, 2:4] = rx(arg_value)
423+
mat[2:4, 2:4] = rx(arg_value).full()
424424
return Qobj(mat, dims=[[2, 2], [2, 2]])
425425

426426

0 commit comments

Comments
 (0)