Skip to content

Commit f409ff7

Browse files
committed
Changes.
1 parent 76c357a commit f409ff7

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

src/arrays/ladderops.jl

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,45 +37,7 @@ function momentumop(n::Int)
3737
return scale(im/sqrt(2.), cop-cop')
3838
end
3939

40-
function spin_h1(j::Float64)
41-
if (isinteger(2*j) && j>0)
42-
m = reverse([-j:j-1])
43-
N = length(m)+1
44-
m_coeffs = [sqrt(j*(j+1.0) - (x+1.0)*x) for x in m]
45-
return spdiagm(m_coeffs,1,N,N)
46-
else
47-
return error("j must be non-negative integer or half integer")
48-
end
49-
end
50-
51-
function spin_h2(j::Float64)
52-
if (isinteger(2*j) && j>0)
53-
m = reverse([-j:j])
54-
N = length(m)
55-
return spdiagm(m,0,N,N)
56-
else
57-
return error("j must be non-negative integer or half integer")
58-
end
59-
end
60-
61-
spin_jx(j::Float64) = QuArray(0.5*(spin_h1(j)+spin_h1(j)'))
62-
spin_jy(j::Float64) = QuArray(-0.5*im*(spin_h1(j)-spin_h1(j)'))
63-
spin_jz(j::Float64) = QuArray(spin_h2(j))
64-
spin_jp(j::Float64) = QuArray(spin_h1(j))
65-
spin_jm(j::Float64) = QuArray(spin_h1(j)')
66-
sigmax = 2.0 * spin_jx(0.5)
67-
sigmay = 2.0 * spin_jy(0.5)
68-
sigmaz = 2.0 * spin_jz(0.5)
69-
7040
export raiseop,
7141
lowerop,
7242
positionop,
73-
momentumop,
74-
spin_jx,
75-
spin_jy,
76-
spin_jz,
77-
spin_jp,
78-
spin_jm,
79-
sigmax,
80-
sigmay,
81-
sigmaz
43+
momentumop

0 commit comments

Comments
 (0)