Quanlse/remoteSimulator.py
def remoteSimulatorRunHamiltonian(ham: QHam, state0: ndarray = None, job: QJob = None,
                                  jobList: QJobList = None, isOpen=False) -> QResult:
    """
    Simulate the Hamiltonian using the Quanlse remote simulator.

    :param ham: the QHamiltonian object.
    :param state0: The initial state.
    :param job: the QJob object.
    :param jobList: The QJobList object.
    :param isOpen: Run the simulation of open system using Lindblad master equation if true.
    :return: the QResult object.
    """

    maxEndTime = None
    kwargs = {}
    if state0 is not None:
        kwargs["state0"] = numpyMatrixToDictMatrix(state0)
    if job is not None:
        maxEndTime, _ = job.computeMaxTime()
        kwargs["job"] = job.dump(maxEndTime=maxEndTime)
    if jobList is not None:
        maxTimeList = []
        for job in jobList.jobs:
            maxTime, _ = job.computeMaxTime()
            maxTimeList.append(maxTime)
        maxEndTime = max(maxTimeList)
        kwargs["jobList"] = jobList.dump(maxEndTime=maxEndTime)
    if maxEndTime is None:
        maxEndTime, _ = ham.job.computeMaxTime()
    kwargs["isOpen"] = isOpen

    args = [ham.dump(maxEndTime=maxEndTime)]
    origin = rpcCall("runHamiltonian", args, kwargs)

    return QResult.load(origin["result"])

    Simulate the Hamiltonian using the Quanlse remote simulator.

    :param ham: the QHamiltonian object.
    :param state0: The initial state.
    :param job: the QJob object.
    :param jobList: The QJobList object.
    :param isOpen: Run the simulation of open system using Lindblad master equation if true.
    :return: the QResult object.
    
Simulate the Hamiltonian using the Quanlse remote simulator.
Simulate the Hamiltonian using the Quanlse remote simulator .
def remoteSimulatorRunHamiltonian(ham: QHam, state0: ndarray = None, job: QJob = None,
                                  jobList: QJobList = None, isOpen=False) -> QResult:
    maxEndTime = None
    kwargs = {}
    if state0 is not None:
        kwargs["state0"] = numpyMatrixToDictMatrix(state0)
    if job is not None:
        maxEndTime, _ = job.computeMaxTime()
        kwargs["job"] = job.dump(maxEndTime=maxEndTime)
    if jobList is not None:
        maxTimeList = []
        for job in jobList.jobs:
            maxTime, _ = job.computeMaxTime()
            maxTimeList.append(maxTime)
        maxEndTime = max(maxTimeList)
        kwargs["jobList"] = jobList.dump(maxEndTime=maxEndTime)
    if maxEndTime is None:
        maxEndTime, _ = ham.job.computeMaxTime()
    kwargs["isOpen"] = isOpen
    args = [ham.dump(maxEndTime=maxEndTime)]
    origin = rpcCall("runHamiltonian", args, kwargs)
    return QResult.load(origin["result"])
def remoteSimulatorRunHamiltonian ( ham : QHam , state0 : ndarray = None , job : QJob = None , jobList : QJobList = None , isOpen = False ) -> QResult : maxEndTime = None kwargs = { } if state0 is not None : kwargs [ "state0" ] = numpyMatrixToDictMatrix ( state0 ) if job is not None : maxEndTime , _ = job . computeMaxTime ( ) kwargs [ "job" ] = job . dump ( maxEndTime = maxEndTime ) if jobList is not None : maxTimeList = [ ] for job in jobList . jobs : maxTime , _ = job . computeMaxTime ( ) maxTimeList . append ( maxTime ) maxEndTime = max ( maxTimeList ) kwargs [ "jobList" ] = jobList . dump ( maxEndTime = maxEndTime ) if maxEndTime is None : maxEndTime , _ = ham . job . computeMaxTime ( ) kwargs [ "isOpen" ] = isOpen args = [ ham . dump ( maxEndTime = maxEndTime ) ] origin = rpcCall ( "runHamiltonian" , args , kwargs ) return QResult . load ( origin [ "result" ] )
Simulate the Hamiltonian using the Quanlse remote simulator.
Simulate the Hamiltonian using the Quanlse remote simulator .
"""
    Simulate the Hamiltonian using the Quanlse remote simulator.

    :param ham: the QHamiltonian object.
    :param state0: The initial state.
    :param job: the QJob object.
    :param jobList: The QJobList object.
    :param isOpen: Run the simulation of open system using Lindblad master equation if true.
    :return: the QResult object.
    """
the QResult object.
the QResult object .
ham
QHam
the QHamiltonian object.
the QHamiltonian object .
state0
ndarray
The initial state.
The initial state .
job
QJob
the QJob object.
the QJob object .
jobList
QJobList
The QJobList object.
The QJobList object .
isOpen
Run the simulation of open system using Lindblad master equation if true.
Run the simulation of open system using Lindblad master equation if true .