Skip to content

Commit

Permalink
Change minor comments in the source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Rojkov committed Jul 29, 2024
1 parent 50034e0 commit c6e2fc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/CVsim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module CVsim
using Permutations
using LinearAlgebra

# Parameters of the simulations
# Parameters of the CV simulations
export CVsim_Parameters
include("parameters.jl")

# Fast calculation of the Wigner quasiprobability
# Wigner quasiprobability functions
export wignerify
include("wignerify.jl")

Expand Down
4 changes: 1 addition & 3 deletions src/prepare_GKP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ function albert_preparation(P::CVsim_Parameters;
Δ::Float64 = 0.37,
n_peaks::Int = 51,
GKP_1::Bool = false)

# displace(α) = exp(1im* √2 * dense( imag(α) * position(P.b) - real(α) * momentum(P.b) ))

displace(α) = exp(-1im*imag(α)*real(α)) *
LazyProduct( exp(1im*√2.0 * dense( imag(α)*position(P.b))), P.Tpm,
Expand Down Expand Up @@ -238,7 +236,7 @@ function default_GKP_preparation(P::CVsim_Parameters;
n_peaks::Int = 20
)

# Determine the if one wants to create a minus state
# Determine if one wants to create a minus state
minus_state = ( parity && (period == sqrt(pi)) )
parity_term(ind) = (-1)^(ind*minus_state)

Expand Down
4 changes: 2 additions & 2 deletions src/wignerify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function wignerify(mat::Matrix{ComplexF64})

# Some constants
wig_Np = length(mat[:,1])
wig_pshift = wig_Np ÷ 2 # integer division
wig_pshift = wig_Np ÷ 2

# Extract anti-diagonals from mat and organizing them in columns
mat_skew = zeros(ComplexF64,(wig_Np, wig_Np))
Expand All @@ -59,7 +59,7 @@ function wignerify(mat::Matrix{ComplexF64})
# Fourier transform along the columns
wigner = mapslices(x->fft_op*x, mat_skew; dims=1)

# execute a linear phase shift which is equivalent to a pixel shift on
# Execute a linear phase shift which is equivalent to a pixel shift on
# mat_skew (but the even antidiagonals get a half-odd pixel shift)
shift_amt = ([0:wig_Np-1;] .- (wig_pshift)) .* [0:2:2*wig_Np-2;]'
wigner .*= exp.((2im*pi / wig_Np) .* shift_amt)
Expand Down

0 comments on commit c6e2fc7

Please sign in to comment.