Simulation classes (quanguru.classes.QSimComp)#

Contains the parent class of quantum systems and protocols. Every system and protocol has a simulation, and this class creates this composition.

QSimComp(**kwargs)

Inhereted by the quantum systems and protocols and has a simulation attribute which is an instance of Simulation.

Function Name

Docstrings

Unit Tests

Tutorials

QSimComp

      ✅

    ✅

    ✅

class QSimComp(**kwargs)[source]#

Bases: quanguru.classes.baseClasses.computeBase

Inhereted by the quantum systems and protocols and has a simulation attribute which is an instance of Simulation. The goal for such an attribute is to increase possible ways of running a Simulation.

NOTE : This class branches the inheritance started by paramBoundBase, and this branch extends to quantum systems and protocols.

label: str = 'QSimComp'#

(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

__simulation#
__getattribute__(_QSimComp__name: str)[source]#

Custom __getattribute__ method to get the parameters of the internal simulation object through self

__setattr__(_QSimComp__name: str, _QSimComp__value) None[source]#

Custom __setattr__ method to set the parameters of the internal simulation object through self

property simulation#

returns _QSimComp__simulation attribute (an instance of Simulation).

runSimulation(p=None, coreCount=None)[source]#

an alternative to run the simulation, equivalent to self.simulation.run()

property _initialStateInput#
property simParameters#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simTotalTime#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simStepSize#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simStepCount#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simSamples#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simCompute#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

property simDelStates#

returns a tuple contaning simulation parameters for the self.simulation, which might be bound to some other simulation object and getting values from there.

There are various setters of this property with different names to set the relevant attribute of the simulation. # TODO should we include calculate methods into the tuple ? and have a setter for calculates as well ?

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).

delMatrices(_exclude=[])[source]#

This method extends delMatrices of computeBase to also call delMatrices on self.simulation.