Quanlse/remoteOptimizer.py
def remoteOptimize1QubitGRAPE(ham: QHam, uGoal: Union[ndarray, List[ndarray]], tg: int = 20, iterate: int = 150,
                              xyzPulses: List[int] = None) -> Union[Tuple[QJob, float], Tuple[List[QJob], List[float]]]:
    """
    Optimize a single-qubit gate using Gradient Ascent Pulse Engineering.

    :param ham: the QHamiltonian object.
    :param uGoal: the target unitary.
    :param tg: gate time.
    :param iterate: max number of iteration.
    :param xyzPulses: a list of three integers indicating the numbers of
                      Gaussian pulses superposed on x, y, z controls respectively.
    :return: a tuple containing the QJob list and infidelity list.
    """
    args = [ham.dump(), numpyMatrixToDictMatrix(uGoal)]
    kwargs = {
        "tg": tg,
        "iterate": iterate,
        "xyzPulses": xyzPulses
    }
    origin = rpcCall("1QubitGRAPE", args, kwargs)

    if isinstance(uGoal, list):
        return [QJob.load(o) for o in origin["job"]], origin["inf"]
    else:
        return QJob.load(origin["job"]), origin["inf"]

    Optimize a single-qubit gate using Gradient Ascent Pulse Engineering.

    :param ham: the QHamiltonian object.
    :param uGoal: the target unitary.
    :param tg: gate time.
    :param iterate: max number of iteration.
    :param xyzPulses: a list of three integers indicating the numbers of
                      Gaussian pulses superposed on x, y, z controls respectively.
    :return: a tuple containing the QJob list and infidelity list.
    
Optimize a single-qubit gate using Gradient Ascent Pulse Engineering.
Optimize a single - qubit gate using Gradient Ascent Pulse Engineering .
def remoteOptimize1QubitGRAPE(ham: QHam, uGoal: Union[ndarray, List[ndarray]], tg: int = 20, iterate: int = 150,
                              xyzPulses: List[int] = None) -> Union[Tuple[QJob, float], Tuple[List[QJob], List[float]]]:
    args = [ham.dump(), numpyMatrixToDictMatrix(uGoal)]
    kwargs = {
        "tg": tg,
        "iterate": iterate,
        "xyzPulses": xyzPulses
    }
    origin = rpcCall("1QubitGRAPE", args, kwargs)
    if isinstance(uGoal, list):
        return [QJob.load(o) for o in origin["job"]], origin["inf"]
    else:
        return QJob.load(origin["job"]), origin["inf"]
def remoteOptimize1QubitGRAPE ( ham : QHam , uGoal : Union [ ndarray , List [ ndarray ] ] , tg : int = 20 , iterate : int = 150 , xyzPulses : List [ int ] = None ) -> Union [ Tuple [ QJob , float ] , Tuple [ List [ QJob ] , List [ float ] ] ] : args = [ ham . dump ( ) , numpyMatrixToDictMatrix ( uGoal ) ] kwargs = { "tg" : tg , "iterate" : iterate , "xyzPulses" : xyzPulses } origin = rpcCall ( "1QubitGRAPE" , args , kwargs ) if isinstance ( uGoal , list ) : return [ QJob . load ( o ) for o in origin [ "job" ] ] , origin [ "inf" ] else : return QJob . load ( origin [ "job" ] ) , origin [ "inf" ]
Optimize a single-qubit gate using Gradient Ascent Pulse Engineering.
Optimize a single - qubit gate using Gradient Ascent Pulse Engineering .
"""
    Optimize a single-qubit gate using Gradient Ascent Pulse Engineering.

    :param ham: the QHamiltonian object.
    :param uGoal: the target unitary.
    :param tg: gate time.
    :param iterate: max number of iteration.
    :param xyzPulses: a list of three integers indicating the numbers of
                      Gaussian pulses superposed on x, y, z controls respectively.
    :return: a tuple containing the QJob list and infidelity list.
    """
a tuple containing the QJob list and infidelity list.
a tuple containing the QJob list and infidelity list .
ham
QHam
the QHamiltonian object.
the QHamiltonian object .
uGoal
Union[ndarray, List[ndarray]]
the target unitary.
the target unitary .
tg
int
None
iterate
int
max number of iteration.
max number of iteration .
xyzPulses
List[int]
a list of three integers indicating the numbers of
Gaussian pulses superposed on x, y, z controls respectively.
a list of three integers indicating the numbers of Gaussian pulses superposed on x y z controls respectively .