QuantumControlTestUtils

Github v0.4.0+dev

The QuantumControlTestUtils package collects methods that are used for testing and benchmarking within the JuliaQuantumControl organization

QuantumControlTestUtils.RandomObjects.random_dynamic_generator — Method

Construct the terms of a random dynamic generator (time-dependent Hamiltonian).

using QuantumPropagators: hamiltonian

tlist = collect(range(0, 100, length=1001))
Ĥ = hamiltonian(random_dynamic_generator(N, tlist; kwargs...)...)

returns a tuple of terms that can be passed to QuantumPropagators.hamiltonian (or QuantumControl.hamiltonian) to obtain a Generator. The terms are the random drift operator followed by tuples (Ĥₗ, ϵₗ) of a random control operator Ĥₗ and a control amplitude ϵₗ. QuantumControlTestUtils does not depend on QuantumPropagators, so it does not construct the Generator itself.

By default, the terms describe a real Hermitian generator of dimension N. The generator consists of one random drift term and one random control term with a random control amplitude value ∈ [-1, 1] for each interval of the given tlist. The spectral envelope of the generator will be 1.0. That is, the largest absolute eigenvalue at any point in time should be less than 1.0. The larger N, the more tightly the envelope will fit.

Keyword arguments

  • number_of_controls=1: The number of control terms in the generator.
  • density=1.0: A number > 0.0 and ≤ 1.0. Any value < 1.0 implies a sparse matrix where density is the approximate fraction of non-zero elements to total elements
  • complex=false: Whether the matrix should be real-valued (default) or complex-valued
  • hermitian=false: Whether the matrix should be Hermitian (have real eigenvalues, default) or non-Hermitian (eigenvalues in the complex plane with a circle of the spectral_envelope)
  • spectral_envelope=1.0: An upper bound for the spectral radius for the generator evaluated at different points in time. For large N, the spectral envelope should be approximately touched for the extremal pulse amplitudes, ±1. Note that the average spectral radius is always well within the spectral_envelope`)
  • exact_spectral_envelope=false: If true, the spectral radius when plugging in the extremal pulse amplitudes ±1 will touch exactly the specified spectral_envelope. This is done via diagonalization, so it is only feasible for moderately large dimensions N.
  • amplitudes: If given, a vector of amplitudes to use in the generator. Must be of length number_of_controls. This can be used to supersede the creation of random control pulses.
  • rng=Random.GLOBAL_RNG: The random number generator to use. The call Random.rand(rng, N, N) must produces a real-valued $N×N$ matrix with elements uniformly distributed between 0 and 1

See also

source
QuantumControlTestUtils.RandomObjects.random_matrix — Method

Construct a random matrix.

Ĥ = random_matrix(N; kwargs...)

by default initializes Ĥ as a general complex $N×N$ matrix with a spectral radius of approximately 1.0. Keyword arguments allow to initialize real or complex, Hermitian or non-Hermitian, dense or sparse matrices with arbitrary spectral radius. The non-zero entries in Ĥ will be uniformly distributed around zero, with a range of values that depends on N and the desired spectral radius.

Keyword arguments

  • density=1.0: A number > 0.0 and ≤ 1.0. Any value < 1.0 implies a sparse matrix where density is the approximate fraction of non-zero elements to total elements
  • complex=true: Whether the matrix should be complex-valued (default) or real-valued
  • hermitian=false: Whether the matrix should be general (default) or Hermitian (real eigenvalues)
  • spectral_radius=1.0: The approximate spectral radius, i.e. maximum absolute eigenvalue. This is according to Girko-Ginibri's circular law, in the limit of large $N$
  • exact_spectral_radius=false: If given as true, ensure that the spectral_radius is exact. This is done via diagonalization, so it is only feasible for moderately large dimensions N. On the other hand, for large N, the spectral_radius, respectively the circular law becomes more exact anyway.
  • rng=Random.GLOBAL_RNG: The random number generator to use. The call Random.rand(rng, N, N) must produces a real-valued $N×N$ matrix with elements uniformly distributed between 0 and 1

See also

Hamiltonian.

source