Enumerations

Parameters

CtrlVQE.ParametersModule
Parameters

Standardized interface for interacting with variational parameters.

Most commonly encountered when implementing Signals and Devices.

source
CtrlVQE.Parameters.bind!Function
bind!(entity, x̄::AbstractVector)

Assigns new values for each variational parameter in entity.

Implementation

This method should mutate entity such that, for example, the expression bind!(entity, x̄); ȳ = values(entity); x̄ == ȳ evaluates true. The method should return entity, in accordance with Julia's style guidelines for mutating functions.

source
CtrlVQE.Parameters.countFunction
count(entity)

The number of variational parameters in entity.

Implementation

Must return a non-negative integer.

source
CtrlVQE.Parameters.namesFunction
names(entity)

An ordered list of human-readable names for each variational parameter in entity.

Implementation

Must return a vector of strings.

source
CtrlVQE.Parameters.valuesFunction
values(entity)

An ordered list of the numerical values for each variational parameter in entity.

The resulting array should be treated as read-only, since whether it is or isn't "backed" by entity is not enforced. That means changes to the resulting array MAY or MAY NOT modfiy entity. So don't do it!

Implementation

Must return a vector of some float type.

If at all possible, avoid allocating a new array when calling this function.

source

Validation

CtrlVQE.ValidationModule
Validation

Standardized interface for ensuring user-defined types are consistent with the interface.

source
CtrlVQE.Validation.validateFunction
validate(type)

Check that type is consistent with the interface defined by its supertype.

Each abstract type defined in the core interface implements its own validate, running a suite of interface-compliance and self-consistency checks.

Each type accepts a different collection of keyword arguments:

validate(::IntegrationType)
validate(::SignalType; grid::IntegrationType, t, rms)
validate(::DeviceType; grid::IntegrationType, t)
validate(::EvolutionType; grid::IntegrationType, device::DeviceType, skipgradient)
validate(::CostFunctionType; x, rms)
validate(::EnergyFunction; grid::IntegrationType, device::DeviceType, x, rms)
  • If grid and device are omitted, relevant tests will be skipped.
    • Note in particular that validate(::EvolutionType) requires both in order to validate any evolution at all!
    • Also note that validate(::EnergyFunction) requires both for any validations special to energy functions, and they must be consistent with those used to construct the energy function, but if omitted the usual cost function tests will still occur.
  • t (a single time) and x (a vector of parameters) determine the point at which accuracy checks are conducted. t defaults to one when omitted, and all x default to zero.
  • rms is the maximum root mean square error permitted between analytical gradients and finite differences. It defaults to nothing, which skips the finite difference altogether.
  • skipgradient is a flag indicating whether to skip anlaytical gradient validation, useful for evolution types that don't bother to implement gradientsignals.
source
CtrlVQE.Validation.@withresultMacro
result = @withresult fn(args...; kwargs...)

Validate that a function accepting an optional result kwarg calculates the same value with and without result, and that, with result, the object returned is identical to the one passed.

source

Prototypes

CtrlVQE.Prototypes.PrototypeFunction
Prototype(::Type{T}; kwargs...)

Construct a prototypical object of type T.

Each type accepts a different collection of keyword arguments, which is largely up to the user defining the type, depending on how flexible they'd like their prototype function to be. However, certain keyword arguments must be accepted for certain abstract types, in order for standard tests and benchmarking to work. But even these should be provided sensible default values.

Prototype(::Type{<:DeviceType}; n::Int, T::Real, kwargs...)
Prototype(::Type{<:IntegrationType}; T::Real, r::Int, kwargs...)
  • n is the number of qubits.
  • r is the total number of time steps.
  • T is a default pulse duration (often but not always irrelevant in DeviceTypes).
source

Operators

CtrlVQE.OperatorsModule
Operators

Enumerates various categories of Hermitian observable related to a device.

source
CtrlVQE.Operators.ChannelType
Channel(i,t)

An individual drive term (indexed by i) at a specific time t.

For example, in a transmon device, Channel(q,t) might represent $Ω_q(t) [\exp(iν_qt) a_q + \exp(-iν_qt) a_q']$, the drive for a single qubit.

Note that you are free to have multiple channels for each qubit, or channels which operate on multiple qubits.

source
CtrlVQE.Operators.CouplingType
Coupling(), aka COUPLING

The components of the static Hamiltonian which are non-local to any one qubit.

For example, in a transmon device, Coupling() represents the sum $∑_{p,q} g_{pq} (a_p'a_q + a_q'a_p)$.

source
CtrlVQE.Operators.DriveType
Drive(t)

The sum of all drive terms at a specific time t.

This represents the sum of each Channel(i,t), where i iterates over each drive term in the device.

For example, in a transmon device, Drive(t) might represent $∑_q Ω_q(t) [\exp(iν_qt) a_q + \exp(-iν_qt) a_q']$.

source
CtrlVQE.Operators.GradientType
Gradient(j,t)

An individual gradient operator (indexed by j) at a specific time t.

The gradient operators appear in the derivation of each gradient signal, which are used to calculate analytical gradients of each variational parameter. The gradient operators are very closely related to individual channel operators, but sufficiently distinct that they need to be treated separately.

For example, for a transmon device, each channel operator $Ω_q(t) [\exp(iν_qt) a_q + \exp(-iν_qt) a_q']$ is associated with two gradient operators:

  • $\exp(iν_qt) a_q + \exp(-iν_qt) a_q'$
  • $i[\exp(iν_qt) a_q - \exp(-iν_qt) a_q']$
source
CtrlVQE.Operators.QubitType
Qubit(q)

The component of the static Hamiltonian which is local to qubit q.

For example, in a transmon device, Qubit(2) represents a term $ω_q a_q'a_q - δ_q/2~ a_q'a_q'a_q a_q$.

source
CtrlVQE.Operators.StaticType
Static(), aka STATIC

All components of the static Hamiltonian.

This represents the sum of Uncoupled() and Coupled()

source
CtrlVQE.Operators.UncoupledType
Uncoupled(), aka UNCOUPLED

The components of the static Hamiltonian which are local to each qubit.

This represents the sum of each Qubit(q), where q iterates over each qubit in the device.

For example, in a transmon device, Uncoupled() represents the sum $∑_q (ω_q a_q'a_q - δ_q/2~ a_q'a_q'a_q a_q)$.

source

Bases

CtrlVQE.BasesModule
Bases

Enumerates various linear-algebraic bases for representing statevectors and matrices.

source
CtrlVQE.Bases.BareType
Bare(), aka BARE

The "default" representation, defined by the localalgebra a Device implements.

For transmons, it is the eigenbasis of local number operators $n̂ ≡ a'a$, and generally, it is what would be called the "computational basis".

source
CtrlVQE.Bases.DressedType
Dressed(), aka DRESSED

The eigenbasis of the static Hamiltonian associated with a Device. Eigenvectors are ordered to maximize similarity with an identity matrix. Phases are fixed so that the diagonal is real.

source