Skip to content

Commit

Permalink
reduce JET errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Sep 19, 2024
1 parent 05491d9 commit 2ed7a3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/fastmemlayout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ See also: [`fastrow`](@ref)"""
function fastcolumn end

fastrow(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ} = t
fastrow(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ<:Adjoint} = Tableau(t.phases, t.nqubits, collect(t.xzs))
fastcolumn(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ} = Tableau(t.phases, t.nqubits, collect(t.xzs')')
fastrow(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ<:Adjoint} = Tableau(t.phases, t.nqubits, Matrix(collect(t.xzs)))
fastcolumn(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ} = Tableau(t.phases, t.nqubits, Matrix(collect(t.xzs')'))
fastcolumn(t::Tableau{Tₚᵥ,Tₘ}) where {Tₚᵥ, Tₘ<:Adjoint} = t

fastrow(s::Stabilizer) = Stabilizer(fastrow(s.tab))
Expand Down
2 changes: 1 addition & 1 deletion src/petrajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function petrajectory(state, circuit; branch_weight=1.0, current_order=0, max_or
if status==continue_stat # TODO is the copy below necessary?
out_probs = petrajectory(copy(newstate), rest_of_circuit,
branch_weight=branch_weight*prob, current_order=current_order+order, max_order=max_order)
status_probs .+= out_probs
map!((x,y)-> x+y, status_probs, status_probs, out_probs)
else
status_probs[status.status] += prob*branch_weight
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

@show rep
@test_broken length(JET.get_reports(rep)) == 0
@test length(JET.get_reports(rep)) <= 11
@test length(JET.get_reports(rep)) <= 9
end

0 comments on commit 2ed7a3e

Please sign in to comment.