Quanlse/remoteOptimizer.py
def remoteOptimize1Qubit(ham: QHam, uGoal: Union[ndarray, List[ndarray]], targetInfid, depth=3) \
        -> Union[Tuple[QJob, float], Tuple[List[QJob], List[float]]]:
    """
    Optimize an arbitrary superconducting single-qubit gate by Quanlse cloud service.

    :param ham: the QHamiltonian object.
    :param uGoal: the goal unitary matrices for optimization.
    :param depth: maximum circuit depth (pulse number).
    :param targetInfid: target infidelity.
    :return: a tuple containing the QJob list and infidelity list.
    """
    args = [ham.dump(), numpyMatrixToDictMatrix(uGoal)]
    kwargs = {"targetInfid": targetInfid, "depth": depth}
    origin = rpcCall("1Qubit", 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 an arbitrary superconducting single-qubit gate by Quanlse cloud service.

    :param ham: the QHamiltonian object.
    :param uGoal: the goal unitary matrices for optimization.
    :param depth: maximum circuit depth (pulse number).
    :param targetInfid: target infidelity.
    :return: a tuple containing the QJob list and infidelity list.
    
Optimize an arbitrary superconducting single-qubit gate by Quanlse cloud service.
Optimize an arbitrary superconducting single - qubit gate by Quanlse cloud service .
def remoteOptimize1Qubit(ham: QHam, uGoal: Union[ndarray, List[ndarray]], targetInfid, depth=3) \
        -> Union[Tuple[QJob, float], Tuple[List[QJob], List[float]]]:
    args = [ham.dump(), numpyMatrixToDictMatrix(uGoal)]
    kwargs = {"targetInfid": targetInfid, "depth": depth}
    origin = rpcCall("1Qubit", 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 remoteOptimize1Qubit ( ham : QHam , uGoal : Union [ ndarray , List [ ndarray ] ] , targetInfid , depth = 3 ) -> Union [ Tuple [ QJob , float ] , Tuple [ List [ QJob ] , List [ float ] ] ] : args = [ ham . dump ( ) , numpyMatrixToDictMatrix ( uGoal ) ] kwargs = { "targetInfid" : targetInfid , "depth" : depth } origin = rpcCall ( "1Qubit" , 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 an arbitrary superconducting single-qubit gate by Quanlse cloud service.
Optimize an arbitrary superconducting single - qubit gate by Quanlse cloud service .
"""
    Optimize an arbitrary superconducting single-qubit gate by Quanlse cloud service.

    :param ham: the QHamiltonian object.
    :param uGoal: the goal unitary matrices for optimization.
    :param depth: maximum circuit depth (pulse number).
    :param targetInfid: target infidelity.
    :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 goal unitary matrices for optimization.
the goal unitary matrices for optimization .
targetInfid
None
depth
maximum circuit depth (pulse number).
maximum circuit depth ( pulse number ) .