Skip to content

Commit 46ff8d4

Browse files
committed
Fix some issues with op
1 parent 9d3d9d3 commit 46ff8d4

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/SiteTypes/sitetype.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ function op(name::AbstractString, s::Index...; adjoint::Bool=false, kwargs...)
337337
# otherwise try calling a function of the form:
338338
# op!(::ITensor, ::OpName, ::SiteType, ::Index...; kwargs...)
339339
#
340-
Op = ITensor(prime.(s)..., dag.(s)...)
341-
for st in common_stypes
342-
op!(Op, opn, st, s...; kwargs...)
343-
if !isempty(Op)
344-
adjoint && return swapprime(dag(Op), 0 => 1)
345-
return Op
346-
end
347-
end
340+
## Op = ITensor(prime.(s)..., dag.(s)...)
341+
## for st in common_stypes
342+
## op!(Op, opn, st, s...; kwargs...)
343+
## if !isempty(Op)
344+
## adjoint && return swapprime(dag(Op), 0 => 1)
345+
## return Op
346+
## end
347+
## end
348348

349349
if length(s) > 1
350350
# No overloads for common tags found. It might be a

src/SiteTypes/sitetypes/qubit.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ state(::StateName"Tetra4", t::SiteType"Qubit") = [
9090
2 / 3 * exp(im * 4π / 3)
9191
]
9292

93+
op(::OpName"Id", ::SiteType"Qubit") = [
94+
1 0
95+
0 1
96+
]
97+
9398
#
9499
# 1-Qubit gates
95100
#

src/SiteTypes/sitetypes/spinone.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ state(::StateName"Y+", ::SiteType"S=1") = [-1 / 2, -im / sqrt(2), 1 / 2]
5454
state(::StateName"Y0", ::SiteType"S=1") = [1 / sqrt(2), 0, 1 / sqrt(2)]
5555
state(::StateName"Y-", ::SiteType"S=1") = [-1 / 2, im / sqrt(2), 1 / 2]
5656

57+
op(::OpName"Id", ::SiteType"S=1") = [
58+
1.0 0.0 0.0
59+
0.0 1.0 0.0
60+
0.0 0.0 1.0
61+
]
62+
5763
op(::OpName"Sz", ::SiteType"S=1") = [
5864
1.0 0.0 0.0
5965
0.0 0.0 0.0

0 commit comments

Comments
 (0)