PulseSequenceRandomizedRotations submodule
Contains functions to animate and calculate states using pulse sequences with arbitrary x- and randomized z-rotations.
Usage
using BlochSphereBigFloat
using BlochSphereBigFloat.PulseSequenceRandomizedRotations
Index
BlochSphereBigFloat.PulseSequenceRandomizedRotations
BlochSphereBigFloat.PauliX
BlochSphereBigFloat.PauliY
BlochSphereBigFloat.PauliZ
BlochSphereBigFloat.SingleQubitState
BlochSphereBigFloat.StereographicCoordinates
Base.convert
Base.convert
Base.convert
Base.getproperty
Base.iterate
Base.length
Base.propertynames
Base.show
BlochSphereBigFloat.BlochVec
BlochSphereBigFloat.PulseSequenceRandomizedRotations.animate_sequence_path
BlochSphereBigFloat.PulseSequenceRandomizedRotations.overlap_by_sequence
BlochSphereBigFloat.PulseSequenceRandomizedRotations.overlap_by_sequence_threaded
BlochSphereBigFloat.PulseSequenceRandomizedRotations.plot_sequence_path
BlochSphereBigFloat.PulseSequenceRandomizedRotations.plot_sequence_path_triple
BlochSphereBigFloat.PulseSequenceRandomizedRotations.seq2vals
BlochSphereBigFloat.PulseSequenceRandomizedRotations.states_by_sequence
BlochSphereBigFloat.PulseSequenceRandomizedRotations.states_by_sequence_threaded
BlochSphereBigFloat.PulseSequenceRandomizedRotations.vals2sequence
BlochSphereBigFloat.Rx
BlochSphereBigFloat.Ry
BlochSphereBigFloat.Rz
BlochSphereBigFloat.ep
BlochSphereBigFloat.interpolate_path
BlochSphereBigFloat.numdigits
BlochSphereBigFloat.pBloch
BlochSphereBigFloat.pBloch
BlochSphereBigFloat.plot_axis_arrow
BlochSphereBigFloat.projection
BlochSphereBigFloat.projection
BlochSphereBigFloat.projection
BlochSphereBigFloat.projection
BlochSphereBigFloat.projection
BlochSphereBigFloat.projection
BlochSphereBigFloat.setup_blochplot
BlochSphereBigFloat.setup_doubleplot
BlochSphereBigFloat.setup_tripleplot
API
BlochSphereBigFloat.PulseSequenceRandomizedRotations
— Modulesubmodule PulseSequenceRandomizedRotations
Contains functions to animate and calculate states using pulse sequences with arbitrary x- and randomized z-rotations.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.animate_sequence_path
— Methodfunction animate_sequence_path(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}, N::Int64; s_start=false, plot_trace=true, plot_step_trace=false, plot_arrow=false, fps=24, markersize=5, kwargs...)
Animates the path of a sequence of single qubit states on the Bloch sphere, given a vector of frequencies ωs
and a sequence of pulses defined by pulses
. Each pulse is either a rotation around the z-axis with frequency ωs[i]
and duration t
, or a rotation around the x-axis with angle t
. The initial state is given by s_start
, and the number of steps for the maximal pulse is defined by N
.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.overlap_by_sequence
— Methodfunction overlap_by_sequence(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}; s_start::SingleQubitState=SingleQubitState(1,1), s_target::SingleQubitState=SingleQubitState(1,0))
Calculates the overlap of the states obtained from states_by_sequence
with a target state s_target
. The overlap is computed as the squared absolute value of the inner product between each state and the target state.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.overlap_by_sequence_threaded
— Methodfunction overlap_by_sequence_threaded(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}; s_start::SingleQubitState=SingleQubitState(1,1), s_target::SingleQubitState=SingleQubitState(1,0))
Calculates the overlap of the states obtained from states_by_sequence_threaded
with a target state s_target
, using multithreading for performance. The overlap is computed as the squared absolute value of the inner product between each state and the target state.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.plot_sequence_path
— Methodfunction plot_sequence_path(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}, N::Int64; s_start=SingleQubitState([1,1]), pBlochargs=(colormap=:viridis,), kwargs...)
Plots the path of a sequence of single qubit states on the Bloch sphere, given a vector of frequencies ωs
and a sequence of pulses defined by pulses
. Each pulse is either a rotation around the z-axis with frequency ωs[i]
and duration t
, or a rotation around the x-axis with angle t
. The initial state is given by s_start
, and the number of steps for each pulse is defined by N
.
For a mutable version, use plot_sequence_path!
.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.plot_sequence_path_triple
— Methodfunction plot_sequence_path_triple(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}, N::Int64; kwargs...)
Like plot_sequence_path
, but as a triple plot (Bloch sphere, stereographic projection north pole, stereographic projection south pole).
BlochSphereBigFloat.PulseSequenceRandomizedRotations.seq2vals
— Methodfunction seq2vals(sequence::Vector{Tuple{Symbol, BigFloat}})::Vector{BigFloat}
Converts a sequence of tuples (direction, value) into a vector of BigFloat
values, extracting only the values from the tuples.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.states_by_sequence
— Methodfunction states_by_sequence(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}; s_start::SingleQubitState=SingleQubitState(1,1))
Calculates the states of a single qubit after applying a sequence of pulses defined by pulses
to the initial state s_start
. Each pulse is either a rotation around the z-axis with frequency ωs[i]
and duration t
, or a rotation around the x-axis with angle t
.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.states_by_sequence_threaded
— Methodfunction states_by_sequence_threaded(ωs::Vector{BigFloat}, pulses::Vector{Tuple{Symbol, BigFloat}}; s_start::SingleQubitState=SingleQubitState(1,1))
Calculates the states of a single qubit after applying a sequence of pulses defined by pulses
to the initial state s_start
, using multithreading for performance. Each pulse is either a rotation around the z-axis with frequency ωs[i]
and duration t
, or a rotation around the x-axis with angle t
.
BlochSphereBigFloat.PulseSequenceRandomizedRotations.vals2sequence
— Methodfunction vals2sequence(vals::Vector{BigFloat})::Vector{Tuple{Symbol, BigFloat}}
Converts a vector of BigFloat
values into a sequence of tuples, alternating between :z and :x directions. The length of the input vector must be even.