Skip to content

Commit 92daa0b

Browse files
Change show methods
1 parent aa46a4e commit 92daa0b

File tree

15 files changed

+53
-59
lines changed

15 files changed

+53
-59
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
attributes:
2323
label: Code Output
2424
description: Please paste the relevant output here (automatically formatted)
25-
placeholder: "Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true\n2×2 Diagonal{ComplexF64, Vector{ComplexF64}}:\n 1.0+0.0im ⋅ \n ⋅ 1.0+0.0im"
25+
placeholder: "Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true\n2×2 Diagonal{ComplexF64, Vector{ComplexF64}}:\n 1.0+0.0im ⋅ \n ⋅ 1.0+0.0im"
2626
render: shell
2727
- type: textarea
2828
id: expected-behaviour

docs/src/users_guide/extensions/cuda.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ V = fock(2, 0) # CPU dense vector
3636
```
3737

3838
```
39-
Quantum Object: type=Ket dims=[2] size=(2,)
39+
Quantum Object: type=Ket() dims=[2] size=(2,)
4040
2-element Vector{ComplexF64}:
4141
1.0 + 0.0im
4242
0.0 + 0.0im
@@ -47,7 +47,7 @@ cu(V)
4747
```
4848

4949
```
50-
Quantum Object: type=Ket dims=[2] size=(2,)
50+
Quantum Object: type=Ket() dims=[2] size=(2,)
5151
2-element CuArray{ComplexF64, 1, CUDA.DeviceMemory}:
5252
1.0 + 0.0im
5353
0.0 + 0.0im
@@ -58,7 +58,7 @@ cu(V; word_size = 32)
5858
```
5959

6060
```
61-
Quantum Object: type=Ket dims=[2] size=(2,)
61+
Quantum Object: type=Ket() dims=[2] size=(2,)
6262
2-element CuArray{ComplexF32, 1, CUDA.DeviceMemory}:
6363
1.0 + 0.0im
6464
0.0 + 0.0im
@@ -69,7 +69,7 @@ M = Qobj([1 2; 3 4]) # CPU dense matrix
6969
```
7070

7171
```
72-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=false
72+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=false
7373
2×2 Matrix{Int64}:
7474
1 2
7575
3 4
@@ -80,7 +80,7 @@ cu(M)
8080
```
8181

8282
```
83-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=false
83+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=false
8484
2×2 CuArray{Int64, 2, CUDA.DeviceMemory}:
8585
1 2
8686
3 4
@@ -91,7 +91,7 @@ cu(M; word_size = 32)
9191
```
9292

9393
```
94-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=false
94+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=false
9595
2×2 CuArray{Int32, 2, CUDA.DeviceMemory}:
9696
1 2
9797
3 4
@@ -104,7 +104,7 @@ V = fock(2, 0; sparse=true) # CPU sparse vector
104104
```
105105

106106
```
107-
Quantum Object: type=Ket dims=[2] size=(2,)
107+
Quantum Object: type=Ket() dims=[2] size=(2,)
108108
2-element SparseVector{ComplexF64, Int64} with 1 stored entry:
109109
[1] = 1.0+0.0im
110110
```
@@ -114,7 +114,7 @@ cu(V)
114114
```
115115

116116
```
117-
Quantum Object: type=Ket dims=[2] size=(2,)
117+
Quantum Object: type=Ket() dims=[2] size=(2,)
118118
2-element CuSparseVector{ComplexF64, Int32} with 1 stored entry:
119119
[1] = 1.0+0.0im
120120
```
@@ -124,7 +124,7 @@ cu(V; word_size = 32)
124124
```
125125

126126
```
127-
Quantum Object: type=Ket dims=[2] size=(2,)
127+
Quantum Object: type=Ket() dims=[2] size=(2,)
128128
2-element CuSparseVector{ComplexF32, Int32} with 1 stored entry:
129129
[1] = 1.0+0.0im
130130
```
@@ -134,7 +134,7 @@ M = sigmax() # CPU sparse matrix
134134
```
135135

136136
```
137-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
137+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
138138
2×2 SparseMatrixCSC{ComplexF64, Int64} with 2 stored entries:
139139
⋅ 1.0+0.0im
140140
1.0+0.0im ⋅
@@ -145,7 +145,7 @@ cu(M)
145145
```
146146

147147
```
148-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
148+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
149149
2×2 CuSparseMatrixCSC{ComplexF64, Int32} with 2 stored entries:
150150
⋅ 1.0+0.0im
151151
1.0+0.0im ⋅
@@ -156,7 +156,7 @@ cu(M; word_size = 32)
156156
```
157157

158158
```
159-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
159+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
160160
2×2 CuSparseMatrixCSC{ComplexF32, Int32} with 2 stored entries:
161161
⋅ 1.0+0.0im
162162
1.0+0.0im ⋅

src/entropy.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Pure state:
2222
```jldoctest
2323
julia> ψ = fock(2,0)
2424
25-
Quantum Object: type=Ket dims=[2] size=(2,)
25+
Quantum Object: type=Ket() dims=[2] size=(2,)
2626
2-element Vector{ComplexF64}:
2727
1.0 + 0.0im
2828
0.0 + 0.0im
@@ -35,7 +35,7 @@ Mixed state:
3535
```jldoctest
3636
julia> ρ = maximally_mixed_dm(2)
3737
38-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
38+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
3939
2×2 Diagonal{ComplexF64, Vector{ComplexF64}}:
4040
0.5-0.0im ⋅
4141
⋅ 0.5-0.0im

src/negativity.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and ``\Vert \hat{X} \Vert_1=\textrm{Tr}\sqrt{\hat{X}^\dagger \hat{X}}`` is the t
2020
```jldoctest
2121
julia> Ψ = bell_state(0, 0)
2222
23-
Quantum Object: type=Ket dims=[2, 2] size=(4,)
23+
Quantum Object: type=Ket() dims=[2, 2] size=(4,)
2424
4-element Vector{ComplexF64}:
2525
0.7071067811865475 + 0.0im
2626
0.0 + 0.0im
@@ -29,7 +29,7 @@ Quantum Object: type=Ket dims=[2, 2] size=(4,)
2929
3030
julia> ρ = ket2dm(Ψ)
3131
32-
Quantum Object: type=Operator dims=[2, 2] size=(4, 4) ishermitian=true
32+
Quantum Object: type=Operator() dims=[2, 2] size=(4, 4) ishermitian=true
3333
4×4 Matrix{ComplexF64}:
3434
0.5+0.0im 0.0+0.0im 0.0+0.0im 0.5+0.0im
3535
0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im

src/qobj/arithmetic_and_attributes.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Note that this function only supports for [`Operator`](@ref) and [`SuperOperator
241241
```jldoctest
242242
julia> a = destroy(20)
243243
244-
Quantum Object: type=Operator dims=[20] size=(20, 20) ishermitian=false
244+
Quantum Object: type=Operator() dims=[20] size=(20, 20) ishermitian=false
245245
20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
246246
⎡⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⎤
247247
⎢⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⎥
@@ -278,7 +278,7 @@ Return the standard vector `p`-norm or [Schatten](https://en.wikipedia.org/wiki/
278278
```jldoctest
279279
julia> ψ = fock(10, 2)
280280
281-
Quantum Object: type=Ket dims=[10] size=(10,)
281+
Quantum Object: type=Ket() dims=[10] size=(10,)
282282
10-element Vector{ComplexF64}:
283283
0.0 + 0.0im
284284
0.0 + 0.0im
@@ -470,7 +470,7 @@ Two qubits in the state ``\ket{\psi} = \ket{e,g}``:
470470
```jldoctest
471471
julia> ψ = kron(fock(2,0), fock(2,1))
472472
473-
Quantum Object: type=Ket dims=[2, 2] size=(4,)
473+
Quantum Object: type=Ket() dims=[2, 2] size=(4,)
474474
4-element Vector{ComplexF64}:
475475
0.0 + 0.0im
476476
1.0 + 0.0im
@@ -479,7 +479,7 @@ Quantum Object: type=Ket dims=[2, 2] size=(4,)
479479
480480
julia> ptrace(ψ, 2)
481481
482-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
482+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
483483
2×2 Matrix{ComplexF64}:
484484
0.0+0.0im 0.0+0.0im
485485
0.0+0.0im 1.0+0.0im
@@ -489,7 +489,7 @@ or in an entangled state ``\ket{\psi} = \frac{1}{\sqrt{2}} \left( \ket{e,e} + \k
489489
```jldoctest
490490
julia> ψ = 1 / √2 * (kron(fock(2,0), fock(2,0)) + kron(fock(2,1), fock(2,1)))
491491
492-
Quantum Object: type=Ket dims=[2, 2] size=(4,)
492+
Quantum Object: type=Ket() dims=[2, 2] size=(4,)
493493
4-element Vector{ComplexF64}:
494494
0.7071067811865475 + 0.0im
495495
0.0 + 0.0im
@@ -498,7 +498,7 @@ Quantum Object: type=Ket dims=[2, 2] size=(4,)
498498
499499
julia> ptrace(ψ, 1)
500500
501-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
501+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
502502
2×2 Matrix{ComplexF64}:
503503
0.5+0.0im 0.0+0.0im
504504
0.0+0.0im 0.5+0.0im

src/qobj/boolean_functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ isoperket(A) = false # default case
5656
Checks if the [`AbstractQuantumObject`](@ref) `A` is a [`SuperOperator`](@ref). Default case returns `false` for any other inputs.
5757
"""
5858
issuper(A::AbstractQuantumObject) = issuper(typeof(A))
59-
issuper(::Type{<:AbstractQuantumObject{SuperOperator,N}}) where {N} = true
59+
issuper(::Type{<:AbstractQuantumObject{<:SuperOperatorType,N}}) where {N} = true
6060
issuper(A) = false # default case
6161

6262
@doc raw"""

src/qobj/eigsolve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ julia> λ
4747
julia> ψ
4848
2-element Vector{QuantumObject{Ket, Dimensions{1, Tuple{Space}}, Vector{ComplexF64}}}:
4949
50-
Quantum Object: type=Ket dims=[2] size=(2,)
50+
Quantum Object: type=Ket() dims=[2] size=(2,)
5151
2-element Vector{ComplexF64}:
5252
-0.7071067811865475 + 0.0im
5353
0.7071067811865475 + 0.0im
5454
55-
Quantum Object: type=Ket dims=[2] size=(2,)
55+
Quantum Object: type=Ket() dims=[2] size=(2,)
5656
2-element Vector{ComplexF64}:
5757
0.7071067811865475 + 0.0im
5858
0.7071067811865475 + 0.0im

src/qobj/functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Returns the [Kronecker product](https://en.wikipedia.org/wiki/Kronecker_product)
169169
```jldoctest
170170
julia> a = destroy(20)
171171
172-
Quantum Object: type=Operator dims=[20] size=(20, 20) ishermitian=false
172+
Quantum Object: type=Operator() dims=[20] size=(20, 20) ishermitian=false
173173
20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
174174
⎡⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⎤
175175
⎢⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⎥

src/qobj/operators.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ This operator acts on a fock state as ``\hat{a} \ket{n} = \sqrt{n} \ket{n-1}``.
8787
```jldoctest
8888
julia> a = destroy(20)
8989
90-
Quantum Object: type=Operator dims=[20] size=(20, 20) ishermitian=false
90+
Quantum Object: type=Operator() dims=[20] size=(20, 20) ishermitian=false
9191
20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
9292
⎡⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⎤
9393
⎢⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⎥
@@ -113,7 +113,7 @@ This operator acts on a fock state as ``\hat{a}^\dagger \ket{n} = \sqrt{n+1} \ke
113113
```jldoctest
114114
julia> a_d = create(20)
115115
116-
Quantum Object: type=Operator dims=[20] size=(20, 20) ishermitian=false
116+
Quantum Object: type=Operator() dims=[20] size=(20, 20) ishermitian=false
117117
20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
118118
⎡⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⎤
119119
⎢⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⎥
@@ -243,21 +243,21 @@ Note that if the parameter `which` is not specified, returns a set of Spin-`j` o
243243
```jldoctest
244244
julia> jmat(0.5, :x)
245245
246-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
246+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=true
247247
2×2 SparseMatrixCSC{ComplexF64, Int64} with 2 stored entries:
248248
⋅ 0.5+0.0im
249249
0.5+0.0im ⋅
250250
251251
julia> jmat(0.5, Val(:-))
252252
253-
Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=false
253+
Quantum Object: type=Operator() dims=[2] size=(2, 2) ishermitian=false
254254
2×2 SparseMatrixCSC{ComplexF64, Int64} with 1 stored entry:
255255
⋅ ⋅
256256
1.0+0.0im ⋅
257257
258258
julia> jmat(1.5, Val(:z))
259259
260-
Quantum Object: type=Operator dims=[4] size=(4, 4) ishermitian=true
260+
Quantum Object: type=Operator() dims=[4] size=(4, 4) ishermitian=true
261261
4×4 SparseMatrixCSC{ComplexF64, Int64} with 4 stored entries:
262262
1.5+0.0im ⋅ ⋅ ⋅
263263
⋅ 0.5+0.0im ⋅ ⋅

src/qobj/quantum_object.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Julia structure representing any time-independent quantum objects. For time-depe
2525
```jldoctest
2626
julia> a = destroy(20)
2727
28-
Quantum Object: type=Operator dims=[20] size=(20, 20) ishermitian=false
28+
Quantum Object: type=Operator() dims=[20] size=(20, 20) ishermitian=false
2929
20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
3030
⎡⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⎤
3131
⎢⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⎥

0 commit comments

Comments
 (0)