QProtocol classes (quanguru.classes.QPro
)#
Contains the classes for protocols.
|
|
|
|
|
|
|
|
|
|
|
Function Name |
Docstrings |
Unit Tests |
Tutorials |
---|---|---|---|
genericProtocol |
❌ |
❌ |
❌ |
qProtocol |
❌ |
❌ |
❌ |
copyStep |
❌ |
❌ |
❌ |
freeEvolution |
❌ |
❌ |
❌ |
Gate |
❌ |
❌ |
❌ |
Update |
❌ |
❌ |
❌ |
- class genericProtocol(**kwargs)[source]#
Bases:
quanguru.classes.QSimComp.QSimComp
- label: str = 'genericProtocol'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- numberOfExponentiations = 0#
(class attribute) to store number of exponentiations, incremented by _increaseExponentiationCount method
- classmethod _increaseExponentiationCount()[source]#
This is a classmethod (used internally) to increment the numberOfExponentiations count.
- __currentState#
during time evolution, the current state of the protocol at the current time is stored in this attribute it is an instance of _parameter so that the nested-protocols can refer to the same state that is store by the outer-most protocol.
- __identity#
stores an identity matrix with the total dimension of the system of the protocol. this is used internally and introduces slight performance enhancement.
- __inProtocol#
some steps might be used more than once in the same protocol or in different protocol/s. with this boolean, it is determined if self is already a step in a protocol, so that a copyStep (of self) is used when self is used again as a step in the same protocol or in different protocol/s.
- __fixed#
when parameters of a step are going to be fixed during the whole simulation (including parameter sweeps), we can label it as fixed to optimize number of exponentiations.
- __ratio#
ratio of the stepSize of self to the stepSize of simulation. Used for higher order Trotterisations, so that there is only one step size to be swept and the relative step sizes are determined by this ratio, which might also be negative as required by higher (than 2) Trotterisation orders.
- __updates#
stores a list of updates for this protocol/step.
- _getUnitary#
- sampleStates#
- stepSample#
boolean to determine if a single state or a list of states is samples (related to sampleStates)
- timeDependency#
- __dissipator#
a dictionary to store the dissipator objects used in open-system simulations
- _openSys#
boolean to determine if it is an open-system simulation.
- property hc#
- property dimension#
- property _dissipator#
- property _isOpen#
- property currentState#
- property initialState#
Getter for the simulation initial state, equivalent to
self.simulation.initialState
. This works by assuming that its setter/s makes sure that _stateBase__initialState.value is not None for single systems (if its state is set).
- property updates#
- property ratio#
- property system#
- property fixed#
- property superSys: Any#
superSys property get/sets __superSys protected attribute
- class qProtocol(**kwargs)[source]#
Bases:
quanguru.classes.QPro.genericProtocol
- label: str = 'qProtocol'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- property _paramUpdated#
Gets
_paramBoundBase__paramUpdated
boolean, and sets it forself
and all the other objects in__paramBound
dictionary.
- property steps#
- addSubSys(subSys, **kwargs)[source]#
Adds sub-system/s into subSys dictionary and works with instances, their name/alias, class themselves (creates an instance and adds), and list/tuple containing any combination of these.
- _createUnitary(collapseOps=None, decayRates=None)#
- class copyStep(superSys, **kwargs)[source]#
Bases:
quanguru.classes.base.qBase
- label: str = 'copyStep'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- hc#
- property simulation#
- property _paramUpdated#
- property _isOpen#
- class freeEvolution(**kwargs)[source]#
Bases:
quanguru.classes.QPro.genericProtocol
- label: str = 'freeEvolution'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- _freqCoef = 1#
- _createUnitary(collapseOps=None, decayRates=None)#
- class Gate(**kwargs)[source]#
Bases:
quanguru.classes.QPro.genericProtocol
- label: str = 'Gate'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- __implementation#
- addSubSys(subSys, **kwargs)[source]#
Adds sub-system/s into subSys dictionary and works with instances, their name/alias, class themselves (creates an instance and adds), and list/tuple containing any combination of these.
- property system#
- property implementation#
- class Update(**kwargs)[source]#
Bases:
quanguru.classes.baseClasses.updateBase
- label: str = 'Update'#
(class attribute) class label used in default naming
- _internalInstances: int = 0#
(class attribute) number of instances created internally by the library
- _externalInstances: int = 0#
(class attribute) number of instances created explicitly by the user
- _instances: int = 0#
(class attribute) number of total instances = _internalInstances + _externalInstances
- value#
- setup#
- setback#
- __memoryValue#
- property memoryValue#
- property updateFunction#
The updateFunction property:
getter :
returns _updateBase__function
which is used in custom sweepssetter : sets
_updateBase__function
callabletype :
callable