QuantumSystemModel¶
- class QuantumSystemModel(static_hamiltonian=None, drive_hamiltonian_coefficients=None, drive_hamiltonians=None, static_dissipators=None, drive_dissipator_coefficients=None, drive_dissipators=None)[source]¶
Bases:
object
Quantum system model class.
This class represents an abstract quantum system model containing Hamiltonian and/or Lindblad terms, specified in terms of the abstract operator instances provided in this module. Once constructed, the
get_Solver()
method can be used to convert the model into aSolver
instance with a concrete array representation to solve the system for a given initial state. Alternatively, thesolve()
method can be called to solve the system for an initial state without needing to work with theSolver
directly. See themodels
module for a concrete description of the Schrodinger and Lindblad master equations.Models can be summed together to build more complex models, e.g. for a system with multiple subsystems. See the Systems Modelling Tutorial for an example of intended usage.
Initialize.
- Parameters:
static_hamiltonian (
Optional
[AbstractSubsystemOperator
]) – The static Hamiltonian.drive_hamiltonian_coefficients (
Optional
[List
[str
]]) – A list of string labels for the drive Hamiltonian terms.drive_hamiltonians (
Optional
[List
[AbstractSubsystemOperator
]]) – The Hamiltonian terms with time-dependent coefficients. This is mapped tohamiltonian_operators
inSolver
.static_dissipators (
Optional
[List
[AbstractSubsystemOperator
]]) – The static dissipator terms.drive_dissipator_coefficients (
Optional
[List
[str
]]) – A list of string labels for the drive dissipator terms.drive_dissipators (
Optional
[List
[AbstractSubsystemOperator
]]) – Dissipator terms with time-dependent rates. This is mapped todissipator_operators
inSolver
.
Methods
- dressed_basis(ordered_subsystems=None, ordering='default')[source]¶
Get the DressedBasis object for the system.
- Parameters:
ordered_subsystems (
Optional
[List
]) – Subsystems in the desired order.ordering (
str
) – Ordering convention for the eigenvectors.
- get_Solver(rotating_frame=None, array_library=None, vectorized=False, validate=False, ordered_subsystems=None)[source]¶
Build concrete operators and instantiate solver.
Note that the
map_signal_dictionary()
method can be used to map signals given in a dictionary format{drive_coefficient: s}
, wheredrive_coefficient
is a string indrive_hamiltonian_coefficients + drive_dissipator_coefficients
ands
is a signal, to the required formatting of thesignals
argument inSolver.solve()
.- Parameters:
rotating_frame (
Union
[ndarray
,AbstractSubsystemOperator
,None
]) – Rotating frame to define the solver in.array_library (
Optional
[str
]) – array library to use (e.g. “numpy”, “jax”, “jax_sparse”, “scipy_sparse”)vectorized (
bool
) – If doing lindblad simulation, whether or not to vectorize.validate (
bool
) – Whether or not to validate the operators.ordered_subsystems (
Optional
[List
[Subsystem
]]) – Chosen non-standard ordering for building the solver.
- map_signal_dictionary(signals)[source]¶
Map labelled signal dictionary to the required format for for the signals argument of a
Solver
generated from theget_Solver()
method.- Parameters:
signals (
List
[Union
[ndarray
,number
,int
,float
,complex
,Tracer
,Array
,spmatrix
,BCOO
,list
,Signal
]]) – Signals in dictionary format{label: s}
, forlabel
a string indrive_hamiltonian_coefficients + drive_dissipator_coefficients
ands
a signal.- Returns:
A container of signals formatted for the
signals
argument of theSolver
methodSolver.solve()
.
- solve(signals, t_span, y0, rotating_frame=None, array_library=None, vectorized=False, ordered_subsystems=None, **kwargs)[source]¶
Solve the model.
This method internally constructs a
Solver
instance with fully-formed arrays according to the abstract model specified in this instance, and then solves. Note that thesignals
argument for this method expects a dictionary format mapping the coefficient labels for the drive terms specified at instantiation to the desired coefficient.- Parameters:
signals (
dict
) – Signals in dictionary format{label: s}
, wherelabel
is a string indrive_hamiltonian_coefficients + drive_dissipator_coefficients
, ands
is the corresponding singal.t_span (
Union
[ndarray
,number
,int
,float
,complex
,Tracer
,Array
,spmatrix
,BCOO
,list
]) – Time interval to integrate over.y0 (
Union
[ndarray
,number
,int
,float
,complex
,Tracer
,Array
,spmatrix
,BCOO
,list
,QuantumState
,BaseOperator
]) – Initial state.rotating_frame (
Union
[ndarray
,AbstractSubsystemOperator
,None
]) – Rotating frame to transform the model into. Rotating frames which are diagonal can be supplied as a 1d array of the diagonal elements, to explicitly indicate that they are diagonal.array_library (
Optional
[str
]) – Array library to use for storing operators of underlying model. See the model evaluation section of the Models API documentation for a more detailed description of this argument.vectorized (
Optional
[bool
]) – If including dissipator terms, whether or not to construct theLindbladModel
in vectorized form. See the model evaluation section of the Models API documentation for a more detailed description of this argument.ordered_subsystems (
Optional
[List
[Subsystem
]]) – List ofSubsystem
instances explicitly specifying the ordering of the subsystems desired when building the concrete model.kwargs – Keyword arguments to pass through to
Solver.solve
.
Attributes
- drive_dissipator_coefficients¶
The drive dissipator coefficients.
- drive_dissipators¶
The model drive dissipators.
- drive_hamiltonian_coefficients¶
The drive Hamiltonian coefficients.
- drive_hamiltonians¶
The model drive Hamiltonians.
- static_dissipators¶
The model static dissipators.
- static_hamiltonian¶
The model static Hamiltonian.
- subsystems¶
The model subsystems.