Protocols

The protocols described here specify which methods a class must implement such that it can be used for a specific purpose.

The hierarchy of the protocols for quantum systems is shown in the following diagram.

../_images/Protocols.png
class Evolvable(*args, **kwargs)[source]

Minimal interface for a system that can be time evolved.

Used by rydopt.simulation.evolve().

initial_basis_states()[source]

The initial basis states \((1, 0, ...)\) of appropriate dimension.

Returns:

Tuple of initial basis states.

Return type:

tuple[Array, …]

hamiltonian_functions_for_basis_states()[source]

The Hamiltonian under which the initial basis states evolve.

A separate Hamiltonian function is returned for each initial basis state. In the case of a block-diagonal Hamiltonian, this allows for returning only the block that is of relevance for a particular basis state.

Returns:

Tuple of Hamiltonian functions.

Return type:

tuple[TypeAliasForwardRef(‘HamiltonianFunction’), …]

class GateSystem(*args, **kwargs)[source]

Interface for gates that can be optimized for process fidelity. The interface is derived from Evolvable. Additionally, methods are present for calculating fidelities from time-evolved basis states.

Used by rydopt.simulation.process_fidelity(), rydopt.simulation.average_gate_fidelity(), rydopt.optimization.optimize(), rydopt.characterization.analyze_gate(), and rydopt.characterization.analyze_gate_qutip().

process_fidelity(final_basis_states)[source]

Given the basis states evolved under the pulse, this function calculates the fidelity with respect to the gate’s target state, specified by the gate angles \(\phi, \, \theta, \, \ldots\)

Parameters:

final_basis_states (tuple[Array, ...]) – Time-evolved basis states.

Returns:

Fidelity with respect to the target state.

Return type:

Array

dim()[source]

Hilbert space dimension.

Returns:

Dimensionality \(2^n\), where \(n\) is the number of atoms.

Return type:

int

class RydbergSystem(*args, **kwargs)[source]

Interface for Evolvables that utilize Rydberg states. The interface is derived from Evolvable. Additionally, methods are present for calculating the time spent in Rydberg states during time evolution.

Used by rydopt.simulation.rydberg_time(), rydopt.characterization.analyze_gate(), and rydopt.characterization.analyze_gate_qutip().

rydberg_population_operators_for_basis_states()[source]

For each basis state, the Rydberg population operators count the number of Rydberg excitations on the diagonal.

Returns:

Tuple of operators.

Return type:

tuple[Array, …]

rydberg_time(expectation_values_of_basis_states)[source]

Given the expectation values of Rydberg populations for each basis state, integrated over the full pulse, this function calculates the average time spent in Rydberg states during the gate.

Parameters:

expectation_values_of_basis_states (tuple[Array, ...]) – Expected Rydberg times for each basis state.

Returns:

Averaged Rydberg time \(T_R\).

Return type:

Array

with_decay(decay)[source]

Creates a copy of the gate with a new decay strength.

Parameters:

decay (float) – New decay strength \(\gamma/\Omega_0\).

Returns:

A copy of the gate object with the new decay strength.

Return type:

Self

class PulseAnsatzLike(*args, **kwargs)[source]

Minimal interface for pulse ansatz objects used in simulation and optimization.

evaluate_pulse_functions(t, params)[source]

Evaluate detuning, phase, and Rabi pulse functions at time samples t.

Parameters:
Return type:

tuple[Array, Array, Array, Array]