Model

class Model(name=None)

Represent a coupled spin system.

This class provides a high-level abstraction for simulating quantum systems consisting of multiple coupled spins. It supports adding spins, interactions, static and driving magnetic fields. The model allows calculation of energy levels and eigenstates. In addition, it provides methods for computing parameters required to define control pulses (e.g. splittings, Rabi-frequencies, …). It enables the simulation of the system’s time evolution under the influence of driving fields and additional noise. It is especially suitable for modeling systems like nitrogen-vacancy centers.

Initialize a model.

Parameters:

name (str | None) – Name of the model.

Hint

For example, to initialize a model for a nitrogen-vacancy center including the intrinsic nitrogen nuclear spin, one can use:

model = simphony.default_nv_model(nitrogen_isotope=14)

Methods

add_driving_field(driving_field)

Add driving field to the model.

add_interaction(interaction)

Add interaction to the model.

add_spin(spin)

Add spin to the model.

add_static_field(static_field)

Add static field to the model.

calculate_driving_operators()

Calculate the operators of the driving fields.

calculate_eigenenergies_and_eigenstates()

Calculate the eigenenergies and eigenstates of the static_hamiltonian.

calculate_hamiltonians()

Calculate the static Hamiltonian, the driving operators and the local quasistatic noise operators.

calculate_local_quasistatic_noise_operators()

Calculate the operators associated with the local quasistatic noises.

calculate_static_hamiltonian()

Calculate the static part of the Hamiltonian of the model and store it in static_hamiltonian.

driving_field(name)

Return the instance of the driving field specified by name.

eigenenergy(quantum_nums)

Return the eigenenergy of the static Hamiltonian that associated with the eigenstate that has the largest overlap with the product basis state described by quantum_nums.

eigenstate(quantum_nums)

Return the eigenstate of the static Hamiltonian that has the largest overlap with the product basis state described by quantum_nums.

matrix_element(driving_field_name, state1, ...)

Return the matrix element of the time-independent operator associated with the driving field between two states.

plot_driving_fields([name, function, start, end])

Plot the pulses of the driving fields.

plot_levels([height, width])

Plot the energy levels of the model.

productstate(quantum_nums)

Return the product basis state of the model corresponding to given quantum numbers of the spins.

project_to_qubit_subspace(unitary[, ...])

Project unitary to qubit subspace.

rabi_cycle_amplitude(driving_field_name, ...)

Return the required amplitude of a driving field for a single Rabi cycle assuming resonant transition of the model under the influence of a constant-strength driving field.

rabi_cycle_amplitude_qubit(...[, ...])

Return the required amplitude of a driving field for a single Rabi cycle assuming resonant transition of the model under the influence of a constant-strength driving field.

rabi_cycle_time(driving_field_name, ...)

Return the period time of a Rabi cycle for a resonant transition of the model under the influence of a constant-strength driving field.

rabi_cycle_time_qubit(driving_field_name, ...)

Return the period time of a Rabi cycle for a resonant transition of the model under the influence of a constant-strength driving field.

remove_all_pulses()

Remove all added pulses from all driving fields and reset the virtual z-phases to zero.

rotating_frame_operator(t[, only_diag, ...])

Return the rotating frame operator:

simulate_time_evolution([n_shots, start, ...])

Simulate the time evolution of the model due to the driving fields under the effect of the noise.

spin(name)

Return the instance of the spin specified by name.

splitting(spin_name, quantum_nums, ...)

Return the energy splitting between the two eigenstates of the model.

splitting_qubit(spin_name[, rest_quantum_nums])

Return the energy splitting between the two eigenstates of the model.

state(quantum_nums[, basis, coeffs_basis])

Return the state of the model corresponding to the given quantum numbers.

virtual_phases_operator([only_diag, ...])

Return the operator corresponding the virtual z-phases:

Attributes

basis

Basis of the Hamiltonian.

basis_qubit_subspace

Basis corresponding to the qubit subspace.

dimension

Total dimension of the spin model.

driving_field_names

Names of the driving fields.

driving_fields

Driving fields attached to the model.

driving_operators

Driving operators.

eigenbasis

Eigenbasis of the static Hamiltonian.

initial_state

Initial state of the simulations.

interactions

Interactions attached to the model.

last_pulse_end

End time of the latest pulse among all driving fields.

local_quasistatic_noise_operators

Local quasistatic-noise operators.

n_spins

Number of the spins.

name

Name of the model.

pulses

Pulses of all driving fields.

rotating_frame_frequencies

Rotating frame frequencies.

spin_names

Names of the spins.

spins

Spins attached to the model.

static_field

Static field attached to the model.

static_hamiltonian

Time-independent part of the Hamiltonian.

subdimensions

Dimensions of the spins.

virtual_phases

Virtual z-phases.