Quantum Evolution (quanguru.QuantumToolbox.evolution
)#
Contains functions to create Unitary and open-system super-operators.
Functions#
|
Creates Unitary time evolution operator |
|
TODO : I have generalised the functions, docs need to be updated. |
|
For a time step t, creates Liouvillian |
|
TODO : I have generalised the functions, docs need to be updated. |
|
Creates pre super-operator |
|
Creates pos super-operator |
|
TODO : I have generalised the functions, docs need to be updated. |
Function Name |
Docstrings |
Examples |
Unit Tests |
Tutorials |
---|---|---|---|---|
Unitary |
✅ |
✅ |
❌ |
❌ |
Liouvillian |
✅ |
✅ |
❌ |
❌ |
LiouvillianExp |
✅ |
✅ |
❌ |
❌ |
dissipator |
✅ |
✅ |
✅ |
❌ |
_preSO |
✅ |
✅ |
✅ |
❌ |
_postSO |
✅ |
✅ |
✅ |
❌ |
_prepostSO |
✅ |
✅ |
✅ |
❌ |
- Unitary(Hamiltonian: Union[scipy.sparse._base.spmatrix, numpy.ndarray], timeStep: float = 1.0) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates Unitary time evolution operator
for a given Hamiltonian
and time step t.
Keeps sparse/array as sparse/array.
- Parameters
Hamiltonian (Matrix) – Hamiltonian of the system
timeStep (float) – time used in the exponentiation (default=1.0)
- Returns
Unitary time evolution operator
- Return type
Matrix
Examples
>>> Unitary(2*np.pi*sigmaz(), 1).A array([[1.+2.4492936e-16j, 0.+0.0000000e+00j], [0.+0.0000000e+00j, 1.-2.4492936e-16j]])
- Liouvillian(Hamiltonian: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None, collapseOperators: Optional[List] = None, decayRates: Optional[List] = None, _double: bool = False) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
TODO : I have generalised the functions, docs need to be updated. Creates Liouvillian super-operator
for a Hamiltonian
and collapse operators
(with corresponding decay rates
).
Keeps sparse/array as sparse/array.
- Parameters
Hamiltonian (Matrix or None) – Hamiltonian of the system
collapseOperators (list (of Matrix)) – list of collapse operator for Lindblad dissipator terms
decayRates` (list (of float)) – list of decay rates (if not given assumed to be 1)
- Returns
Liouvillian super-operator
- Return type
Matrix
Examples
>>> Liouvillian(2*np.pi*sigmaz(), [2*np.pi*sigmaz()], [1]).A array([[ 0. +0.j , 0. +0.j , 0. +0.j , 0. +0.j ], [ 0. +0.j , -78.95683521+12.56637061j, 0. +0.j , 0. +0.j ], [ 0. +0.j , 0. +0.j , -78.95683521-12.56637061j, 0. +0.j ], [ 0. +0.j , 0. +0.j , 0. +0.j , 0. +0.j ]])
- LiouvillianExp(Hamiltonian: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None, timeStep: float = 1.0, collapseOperators: Optional[List] = None, decayRates: Optional[List] = None, exp: bool = True, _double: bool = False) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
For a time step t, creates Liouvillian
and exponentiate it, or unitary
for a Hamiltonian
.
Keeps sparse/array as sparse/array.
- Parameters
Hamiltonian (Matrix or None) – Hamiltonian of the system
timeStep (float) – time used in the exponentiation (default=1)
collapseOperators (list (of Matrix)) – list of collapse operator for Lindblad dissipator terms
decayRates (list (of float)) – list of decay rates (if not given assumed to be 1)
exp (bool) – boolean to exponentiate the Liouvillian or not (=True by default)
- Returns
(exponentiated) Liouvillian super-operator
- Return type
Matrix
Examples
>>> LiouvillianExp(2*np.pi*sigmaz(), 1, [], []).A array([[1.+2.4492936e-16j, 0.+0.0000000e+00j], [0.+0.0000000e+00j, 1.-2.4492936e-16j]])
>>> LiouvillianExp(2*np.pi*sigmaz(), 1, [2*np.pi*sigmaz()], [1]).A array([[1.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j], [0.00000000e+00+0.00000000e+00j, 5.12250228e-35-2.50930241e-50j, 0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j], [0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j, 5.12250228e-35+2.50930241e-50j, 0.00000000e+00+0.00000000e+00j], [0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j, 0.00000000e+00+0.00000000e+00j, 1.00000000e+00+0.00000000e+00j]])
- dissipator(operatorA: Union[scipy.sparse._base.spmatrix, numpy.ndarray], operatorB: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None, identity: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None, _double: bool = False) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
TODO : I have generalised the functions, docs need to be updated. Creates the Lindblad dissipator super-operator
for a collapse operator
.
Keeps sparse/array as sparse/array.
- Parameters
collapseOperator (Matrix) – a collapse operator
identity (Matrix or None) – identity operator (exist for internal use and optimisation)
- Returns
Lindblad dissipator
- Return type
Matrix
Examples
>>> dissipator(sigmaz()).A array([[ 0., 0., 0., 0.], [ 0., -2., 0., 0.], [ 0., 0., -2., 0.], [ 0., 0., 0., 0.]])
>>> dissipator(sigmam()).A array([[-1. , 0. , 0. , 0. ], [ 0. , -0.5, 0. , 0. ], [ 0. , 0. , -0.5, 0. ], [ 1. , 0. , 0. , 0. ]])
- _preSO(operator: Union[scipy.sparse._base.spmatrix, numpy.ndarray], identity: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates pre super-operator
for an operator
.
Keeps sparse/array as sparse/array.
- Parameters
operator (Matrix) – a collapse operator
identity (Matrix or None) – identity operator (exist for internal use and optimisations)
- Returns
pre super-operator
- Return type
Matrix
Examples
>>> evolution._preSO(sigmam()).A array([[0., 0., 0., 0.], [1., 0., 0., 0.], [0., 0., 0., 0.], [0., 0., 1., 0.]])
- _postSO(operator: Union[scipy.sparse._base.spmatrix, numpy.ndarray], identity: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates pos super-operator
for an operator
.
Keeps sparse/array as sparse/array.
- Parameters
operator (Matrix) – a collapse operator
identity (Matrix or None) – identity operator (exist for internal use and optimisations)
- Returns
post super-operator
- Return type
Matrix
Examples
>>> evolution._postSO(sigmam()).A array([[0., 0., 1., 0.], [0., 0., 0., 1.], [0., 0., 0., 0.], [0., 0., 0., 0.]])
- _prepostSO(operatorA: Union[scipy.sparse._base.spmatrix, numpy.ndarray], operatorB: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
TODO : I have generalised the functions, docs need to be updated. Creates pre-pos super-operator
for an operator
.
Keeps sparse/array as sparse/array.
- Parameters
operatorA (Matrix) – collapse operator A
operatorB (Matrix) – collapse operator B
- Returns
pre-post super-operator
- Return type
Matrix
Examples
>>> evolution._prepostSO(sigmam()).A array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [1, 0, 0, 0]], dtype=int64)
- evolveOpen(initialState, totalTime, timeStep: float = 1.0, Hamiltonian: Optional[Union[scipy.sparse._base.spmatrix, numpy.ndarray]] = None, collapseOperators: Optional[List] = None, decayRates: Optional[List] = None, calcFunc: Optional[Callable] = None, delStates: Optional[bool] = False, _double: bool = False) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#