QuantumStateTransfer.jl – Private API

Documentation for QuantumStateTransfer's private API.

Note

The following documentation covers only the private API of the package. For public details, see the public API documentation.

QuantumStateTransfer.NotImplementedErrorType
NotImplementedError{Nothing}(f, subtype, abstracttype)
NotImplementedError{Symbol}(f, arg, subtype, abstracttype)

An exception indicating that a function lacks dispatch to handle a specific argument type.

Semantically, this differs from MethodError in that it connotes a developer-side failure to implement a method rather than erroneous user input. Throughout this package, it is often used to warn when an existing function with multiple dispatch on some abstract type is called on a newly created subtype for which no method has been defined.

Fields

  • f::Function: the function called.
  • arg::Symbol: the name of the argument with the unsupported type, if the function has multiple arguments. If the function has only one argument, this field should be set to nothing.
  • subtype::Type: the type of the argument. May be the actual concrete type or some intermediate supertype. (For instance, if the relevant input has concrete type A with hierarchy A <: B <: C and the abstracttype field is C, then both A and B are perfectly valid choices for subtype.)
  • abstracttype::Type: the abstract type under which the argument is meant to fall.

Constructors

  • NotImplementedError(::Function, ::Type, ::Type): constructs a new NotImplementedError instance for a single-argument function. Throws an error if the second type is not abstract or the first type is not a subtype of the second.
  • NotImplementedError(::Function, ::Symbol, ::Type, ::Type): constructs a new NotImplementedError instance for a multi-argument function. Throws an error if the second type is not abstract or the first type is not a subtype of the second.

Supertype Hierarchy

NotImplementedError <: Exception

Notes

This struct was taken from one of the authors' other packages, MatrixBandwidth.jl. To avoid adding an unnecessary dependency, it has been copied here verbatim.

source
QuantumStateTransfer.is_simpleMethod
is_simple(g) -> Bool

Check whether a graph g is simple (i.e., undirected with no self-loops).

Supposing that g represents a quantum spin network (whose walk Hamiltonian is the adjacency matrix A of g), self-loops would indicate couplings between qubits and themselves, which is physically nonsensical. On the other hand, undirectedness is required for the transition matrix $eⁱᵗᴬ$ to be unitary.

Arguments

  • g::AbstractGraph: The graph to check.

Returns

  • ::Bool: true if g is undirected with no self-loops, and false otherwise.

Examples

[TODO: Write here]

source
QuantumStateTransfer.is_zerodiag_symmetricMethod
is_zerodiag_symmetric(A) -> Bool

Check whether a matrix A is symmetric with a zero diagonal.

Supposing that A is the adjacency (and walk Hamiltonian) of a graph representing a quantum spin network, a nonzero diagonal would indicate couplings between qubits and themselves, which is physically nonsensical. On the other hand, symmetry (Hermicity in the general case, but we only consider here real-valued adjacency matrices) is required for the transition matrix $eⁱᵗᴬ$ to be unitary.

Arguments

  • A::AbstractMatrix{<:Real}: The matrix to check.

Returns

  • ::Bool: true if A is symmetric with a zero diagonal, and false otherwise.

Examples

[TODO: Write here]

source

References