Skip to content

Commit

Permalink
remove untested code: JET detected errors in this code, probably due …
Browse files Browse the repository at this point in the history
…to the use of np.exp which seems to have been copied from python's numpy -- as this code is not used or tested I just deleted it
  • Loading branch information
Krastanov committed Nov 5, 2024
1 parent a715dc8 commit 60fe12c
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/BPGates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -679,33 +679,6 @@ function NoisyBellSwap(idx1,idx2,px,py,pz)
return PauliNoiseBellGate(BellSwap(idx1,idx2), px,py,pz)
end

function thermal_relaxation_error(t1::Float64, t2::Float64, gate_time::Float64) # experimental private function for internal use
λ₁ = 1 - np.exp(-gate_time/t1)
t_ϕ = t1*t2 / (2*t1 - t2)
λ₂ = 1 - np.exp(-gate_time/t_ϕ)
return λ₁, λ₂
end

# TODO this function does not add thermal noise to the "wait" times in between gates on the qubits that are not acted upon on the current timestep
function add_thermal_relaxation(circuit, λ₁::Float64, λ₂::Float64) # experimental private function for intenral use
thermal_noisy_circuit = []
for gate in circuit
push!(thermal_noisy_circuit, gate) # apply the original gate
if gate isa PauliNoiseBellGate{CNOTPerm} || gate isa PauliNoiseBellGate{BellSwap} # TODO we should not have such non-general type checks -- this should be using multimethods in order to be extendable
# For two-qubit gates, attach T1 and T2 noise on both qubits
push!(thermal_noisy_circuit, T1NoiseOp(gate.g.idx1, λ₁))
push!(thermal_noisy_circuit, T2NoiseOp(gate.g.idx1, λ₂))
push!(thermal_noisy_circuit, T1NoiseOp(gate.g.idx2, λ₁))
push!(thermal_noisy_circuit, T2NoiseOp(gate.g.idx2, λ₂))
# elseif gate isa NoisyBellMeasureNoisyReset
else
# No thermal relaxation added to measurements
continue
end
end
return thermal_noisy_circuit
end


##############################
# Random
Expand Down

0 comments on commit 60fe12c

Please sign in to comment.