Quanlse/Simulator/__init__.py
def simulate(self, job: QJob = None, state0: ndarray = None, jobList: QJobList = None,
                 measure: List[int] = None, shot: int = None, options: Any = None) -> QResult:
        """
        Calculate the unitary evolution operator with a given Hamiltonian. This function supports
        both single-job and batch-job processing.

        :param job: the QJob object to simulate.
        :param state0: the initial state vector. If None is given, this function will return the time-ordered
                       evolution operator, otherwise returns the final state vector.
        :param jobList: a job list containing the waveform list
        :param measure: indicates the qubit indexes for measurement
        :param shot: return the population of the eigenstates when ``shot`` is provided
        :param options: options pass to the runner function
        :return: result dictionary (or a list of result dictionaries when ``jobList`` is provided)

        This function does provide the option of simulating on local devices. However, Quanlse also provides
        cloud computing services which are significantly faster.

        **Example 1** (single-job processing):

        If ``jobList`` is None, the waveforms in ham will be used for simulation, and return a result dictionary.

        .. code-block:: python

                result = ham.simulate()

        **Example 2** (batch-job processing):

        If ``jobList`` is not None, simulation will use the waveform list for batch-job processing provided in
        jobList, and return a list of result dictionaries.

        .. code-block:: python

                result = ham.simulate(ham, jobList=jobs)

        Here, jobs is a QJobList object, indicating the the waveforms to be used.
        """

        if self.frameMode == 'lab':
            if state0 is None:
                state0 = basis(self.dim, 0)
            if shot is None:
                shot = 1000

        _useHamSimulator = True
        

        # Simulate the QJobs
        if _useHamSimulator:
            result = self._ham.simulate(job=job, state0=state0, jobList=jobList, shot=shot, adaptive=True)
        else:
            raise Error.RuntimeError('Not implemented')

        # Measure the population
        if measure is not None:
            if state0 is not None:
                pass
            else:
                raise ArgumentError("When 'measure' is given, you must input 'state0' or 'shot'!")

        return result

        Calculate the unitary evolution operator with a given Hamiltonian. This function supports
        both single-job and batch-job processing.

        :param job: the QJob object to simulate.
        :param state0: the initial state vector. If None is given, this function will return the time-ordered
                       evolution operator, otherwise returns the final state vector.
        :param jobList: a job list containing the waveform list
        :param measure: indicates the qubit indexes for measurement
        :param shot: return the population of the eigenstates when ``shot`` is provided
        :param options: options pass to the runner function
        :return: result dictionary (or a list of result dictionaries when ``jobList`` is provided)

        This function does provide the option of simulating on local devices. However, Quanlse also provides
        cloud computing services which are significantly faster.

        **Example 1** (single-job processing):

        If ``jobList`` is None, the waveforms in ham will be used for simulation, and return a result dictionary.

        .. code-block:: python

                result = ham.simulate()

        **Example 2** (batch-job processing):

        If ``jobList`` is not None, simulation will use the waveform list for batch-job processing provided in
        jobList, and return a list of result dictionaries.

        .. code-block:: python

                result = ham.simulate(ham, jobList=jobs)

        Here, jobs is a QJobList object, indicating the the waveforms to be used.
        
Calculate the unitary evolution operator with a given Hamiltonian. This function supports
both single-job and batch-job processing.
Calculate the unitary evolution operator with a given Hamiltonian . This function supports both single - job and batch - job processing .
def simulate(self, job: QJob = None, state0: ndarray = None, jobList: QJobList = None,
                 measure: List[int] = None, shot: int = None, options: Any = None) -> QResult:
        if self.frameMode == 'lab':
            if state0 is None:
                state0 = basis(self.dim, 0)
            if shot is None:
                shot = 1000
        _useHamSimulator = True
        if _useHamSimulator:
            result = self._ham.simulate(job=job, state0=state0, jobList=jobList, shot=shot, adaptive=True)
        else:
            raise Error.RuntimeError('Not implemented')
        if measure is not None:
            if state0 is not None:
                pass
            else:
                raise ArgumentError("When 'measure' is given, you must input 'state0' or 'shot'!")
        return result
def simulate ( self , job : QJob = None , state0 : ndarray = None , jobList : QJobList = None , measure : List [ int ] = None , shot : int = None , options : Any = None ) -> QResult : if self . frameMode == 'lab' : if state0 is None : state0 = basis ( self . dim , 0 ) if shot is None : shot = 1000 _useHamSimulator = True if _useHamSimulator : result = self . _ham . simulate ( job = job , state0 = state0 , jobList = jobList , shot = shot , adaptive = True ) else : raise Error . RuntimeError ( 'Not implemented' ) if measure is not None : if state0 is not None : pass else : raise ArgumentError ( "When 'measure' is given, you must input 'state0' or 'shot'!" ) return result
Calculate the unitary evolution operator with a given Hamiltonian.
Calculate the unitary evolution operator with a given Hamiltonian .
"""
        Calculate the unitary evolution operator with a given Hamiltonian. This function supports
        both single-job and batch-job processing.

        :param job: the QJob object to simulate.
        :param state0: the initial state vector. If None is given, this function will return the time-ordered
                       evolution operator, otherwise returns the final state vector.
        :param jobList: a job list containing the waveform list
        :param measure: indicates the qubit indexes for measurement
        :param shot: return the population of the eigenstates when ``shot`` is provided
        :param options: options pass to the runner function
        :return: result dictionary (or a list of result dictionaries when ``jobList`` is provided)

        This function does provide the option of simulating on local devices. However, Quanlse also provides
        cloud computing services which are significantly faster.

        **Example 1** (single-job processing):

        If ``jobList`` is None, the waveforms in ham will be used for simulation, and return a result dictionary.

        .. code-block:: python

                result = ham.simulate()

        **Example 2** (batch-job processing):

        If ``jobList`` is not None, simulation will use the waveform list for batch-job processing provided in
        jobList, and return a list of result dictionaries.

        .. code-block:: python

                result = ham.simulate(ham, jobList=jobs)

        Here, jobs is a QJobList object, indicating the the waveforms to be used.
        """ # Simulate the QJobs # Measure the population
result dictionary (or a list of result dictionaries when ``jobList`` is provided)
This function does provide the option of simulating on local devices. However, Quanlse also provides
cloud computing services which are significantly faster.

Example 1** (single-job processing).

If ``jobList`` is None, the waveforms in ham will be used for simulation, and return a result dictionary.

code-block:: python

result = ham.simulate()

Example 2** (batch-job processing).

If ``jobList`` is not None, simulation will use the waveform list for batch-job processing provided in
jobList, and return a list of result dictionaries.

code-block:: python

result = ham.simulate(ham, jobList=jobs)

Here, jobs is a QJobList object, indicating the the waveforms to be used.
result dictionary ( or a list of result dictionaries when ` ` jobList ` ` is provided ) This function does provide the option of simulating on local devices . However Quanlse also provides cloud computing services which are significantly faster . Example 1 ** ( single - job processing ) . If ` ` jobList ` ` is None the waveforms in ham will be used for simulation and return a result dictionary . code - block :: python result = ham . simulate () Example 2 ** ( batch - job processing ) . If ` ` jobList ` ` is not None simulation will use the waveform list for batch - job processing provided in jobList and return a list of result dictionaries . code - block :: python result = ham . simulate ( ham jobList = jobs ) Here jobs is a QJobList object indicating the the waveforms to be used .
self
job
QJob
the QJob object to simulate.
the QJob object to simulate .
state0
ndarray
the initial state vector. If None is given, this function will return the time-ordered
evolution operator, otherwise returns the final state vector.
the initial state vector . If None is given this function will return the time - ordered evolution operator otherwise returns the final state vector .
jobList
QJobList
a job list containing the waveform list
a job list containing the waveform list
measure
List[int]
indicates the qubit indexes for measurement
indicates the qubit indexes for measurement
shot
int
return the population of the eigenstates when ``shot`` is provided
return the population of the eigenstates when ` ` shot ` ` is provided
options
Any
options pass to the runner function
options pass to the runner function