Skip to content
This repository was archived by the owner on Dec 18, 2021. It is now read-only.

Commit b02cc06

Browse files
committed
rm deprecated blocks
1 parent 75ff946 commit b02cc06

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "YaoBlocks"
22
uuid = "418bc28f-b43b-5e0b-a6e7-61bbc1a2c1df"
3-
version = "0.8.2"
3+
version = "0.9.0"
44

55
[deps]
66
BitBasis = "50ba71b6-fa0f-514d-ae9a-0916efc90dcf"

src/layout.jl

-18
Original file line numberDiff line numberDiff line change
@@ -187,23 +187,17 @@ end
187187
color(m::AbstractBlock) = color(typeof(m))
188188
color(::Type{<:ControlBlock}) = :red
189189
color(::Type{<:ChainBlock}) = :blue
190-
color(::Type{<:MathGate}) = :red
191190
color(::Type{<:Add}) = :red
192191
color(::Type{<:PutBlock}) = :cyan
193-
color(::Type{T}) where {T<:PauliString} = :cyan
194192
color(::Type{<:RepeatedBlock}) = :cyan
195193
color(::Type{<:GeneralMatrixBlock}) = :red
196194

197-
# color(::Type{T}) where {T <: PauliString} = :cyan
198-
# color(::Type{T}) where {T <: Sequential} = :blue
199-
200195
print_block(io::IO, g::PhaseGate) = print(io, "phase(", g.theta, ")")
201196
print_block(io::IO, S::ShiftGate) = print(io, "shift(", S.theta, ")")
202197
print_block(io::IO, R::RotationGate) = print(io, "rot(", summary(content(R)), ", ", R.theta, ")")
203198
print_block(io::IO, x::KronBlock) = printstyled(io, "kron"; bold = true, color = color(KronBlock))
204199
print_block(io::IO, x::ChainBlock) = printstyled(io, "chain"; bold = true, color = color(ChainBlock))
205200
print_block(io::IO, x::UnitaryChannel) = printstyled(io, "unitary_channel"; bold = true)
206-
print_block(io::IO, x::ReflectGate{N}) where {N} = print(io, "reflect($(summary(x.psi)))")
207201
print_block(io::IO, c::Subroutine) = print(io, "Subroutine: ", occupied_locs(c))
208202
print_block(io::IO, c::CachedBlock) = print_block(io, content(c))
209203
print_block(io::IO, c::Add) = printstyled(io, "+"; bold = true, color = color(Add))
@@ -236,14 +230,6 @@ function print_block(io::IO, c::Measure{N,K,OT}) where {N,K,OT}
236230
end
237231

238232
# TODO: use OhMyREPL's default syntax highlighting for functions
239-
function print_block(io::IO, m::MathGate{N,<:LegibleLambda}) where {N}
240-
printstyled(io, "mathgate($(m.f); nbits=$N)"; bold = true, color = color(m))
241-
end
242-
243-
function print_block(io::IO, m::MathGate{N,<:Function}) where {N}
244-
printstyled(io, "mathgate($(nameof(m.f)); nbits=$N)"; bold = true, color = color(m))
245-
end
246-
247233
function print_block(io::IO, te::TimeEvolution)
248234
println(io, "Time Evolution Δt = $(te.dt), tol = $(te.tol)")
249235
print_tree(io, te.H; title = false)
@@ -285,10 +271,6 @@ function print_block(io::IO, rb::RepeatedBlock{N}) where {N}
285271
printstyled(io, ")"; bold = true, color = color(RepeatedBlock))
286272
end
287273

288-
function print_block(io::IO, x::PauliString)
289-
printstyled(io, "PauliString"; bold = true, color = color(PauliString))
290-
end
291-
292274
# forward to simplify interfaces
293275
function print_annotation(
294276
io::IO,

src/primitive/measure.jl

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using YaoBase, YaoArrayRegister, Random
2+
using BitBasis
23
export Measure, MeasureAndReset, AllLocs, ComputationalBasis, chmeasureoperator
34

45
"""

0 commit comments

Comments
 (0)