Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/QuantumCliffordGPUExt/fastmemlayout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TableauAdj is the type of Tableau with its data stored in an adjoint of a CUDA a
rest of the fastrow, fastcolumn functions are implemented in QuantumClifford.jl
"""

# todo when we use to_gpu, to_cpu the efffect of fastrow, fastcolumn disappears
# todo when we use to_gpu, to_cpu the effect of fastrow, fastcolumn disappears
fastrow(t::TableauCUDA) = t
fastrow(t::TableauAdj) = Tableau(t.phases, t.nqubits, CuArray(t.xzs))
fastcolumn(t::TableauCUDA) = Tableau(t.phases, t.nqubits, CuArray(t.xzs')')
Expand Down
2 changes: 1 addition & 1 deletion src/ecc/codes/concat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function parity_checks(c::Concat)
phases_logx₁ = phases(logx_ops(c₁))
h_logz₁ = stab_to_gf2(logz_ops(c₁))
phases_logz₁ = phases(logz_ops(c₁))
# parity checks of c₂ with qubits repalced with logical qubits of c₁
# parity checks of c₂ with qubits replaced with logical qubits of c₁
outer_check_h = transpose(hcat([vcat(
kron(h₂[i, 1:end÷2], h_logx₁[j, 1:end÷2]) .⊻ kron(h₂[i, end÷2+1:end], h_logz₁[j, 1:end÷2]), # X part
kron(h₂[i, 1:end÷2], h_logx₁[j, end÷2+1:end]) .⊻ kron(h₂[i, end÷2+1:end], h_logz₁[j, end÷2+1:end]) # Z part
Expand Down
8 changes: 8 additions & 0 deletions src/noise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,11 @@ function applybranches(s::AbstractQCState, g::NoisyGate; max_order=1)
news, _,_,_ = applybranches(s,g.gate,max_order=max_order)[1] # TODO this assumes only one always successful branch for the gate
return [(state, continue_stat, prob, order) for (state, prob, order) in applynoise_branches(news, g.noise, affectedqubits(g), max_order=max_order)]
end

function _sentinel_affectedqubits end
QuantumClifford._sentinel_affectedqubits(x::Any) = QuantumClifford.affectedqubits(x)
QuantumClifford._sentinel_affectedqubits(::QuantumClifford.NoiseOpAll) = missing

function _sentinel_maximum end
QuantumClifford._sentinel_maximum(x::Any) = maximum(x)
QuantumClifford._sentinel_maximum(::Missing) = 0
5 changes: 5 additions & 0 deletions src/petrajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ end

See also: [`pftrajectories`](@ref), [`mctrajectories`](@ref)"""
function petrajectories(initialstate, circuit; branch_weight=1.0, max_order=1, keepstates::Bool=false)
for circuit_op in circuit
if(_sentinel_maximum(_sentinel_affectedqubits(circuit_op)) > nqubits(initialstate))
throw(ArgumentError(lazy"""Qubit out of bounds for $circuit_op. Attempting to access a $(nqubits(initialstate)) qubit state at index $(_sentinel_maximum(_sentinel_affectedqubits(circuit_op)))"""))
end
end
if keepstates
return petrajectory_keep(initialstate, circuit; branch_weight=branch_weight, current_order=0, max_order=max_order)
else
Expand Down
2 changes: 1 addition & 1 deletion src/randoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function _reset!(memory::RandDestabMemory)
end
end

# Allocation free inverse of upper trinagular int matrix with 1 on diagonal.
# Allocation free inverse of upper triangular int matrix with 1 on diagonal.
function _inv!(inverse, A)
for i in 2:size(A, 2)
for j in 1:i-1
Expand Down
2 changes: 1 addition & 1 deletion src/sumtypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ end


##
# `concrete_typeparams` annotations for the parameteric types we care about
# `concrete_typeparams` annotations for the parametric types we care about
##

function concrete_typeparams(t::Type{ClassicalXOR})
Expand Down
2 changes: 1 addition & 1 deletion test/test_noisycircuits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
@test pet_y[true_success_stat] == 1
@test pet_y[failure_stat] == 0

#checks probabilstic case to see if the phase of measurement anticommuting stabilizer is the same in both branches
#checks probabilistic case to see if the phase of measurement anticommuting stabilizer is the same in both branches
ghz_state = S"XXX ZZI IZZ"
reg = Register(ghz_state, [0])
branches = applybranches(reg, sMRZ(1,1))
Expand Down
Loading