Quanlse/Scheduler/Superconduct/GeneratorCloud.py
def generate1Q(ham: 'QHamiltonian' = None, cirLine: CircuitLine = None,
               scheduler: 'SchedulerSuperconduct' = None) -> QJob:
    """
    Default generator for single qubit gates.

    :param ham: QHam object containing the system information
    :param cirLine: a CircuitLine object containing the gate information
    :param scheduler: the instance of Quanlse Scheduler Superconducting
    :return: returned QJob object
    """
    subHam = ham.subSystem(cirLine.qRegIndexList)
    if cirLine.data.name in ['X', 'RX']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=2, targetInfid=0.0001)
    elif cirLine.data.name in ['Y', 'RY']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=2, targetInfid=0.0001)
    elif cirLine.data.name in ['Z', 'S', 'T', 'RZ']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=4, targetInfid=0.0001)
    elif cirLine.data.name in ['U', "H"]:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=4, targetInfid=0.0001)
    else:
        raise Error.ArgumentError(f"Unsupported single qubit gate {cirLine.data.name}.")

    print(f"Infidelity of {cirLine.data.name} on qubit {cirLine.qRegIndexList}: {inf}")

    subHam.job = job
    return subHam.outputInverseJob(ham.subSysNum, ham.sysLevel, ham.dt)

    Default generator for single qubit gates.

    :param ham: QHam object containing the system information
    :param cirLine: a CircuitLine object containing the gate information
    :param scheduler: the instance of Quanlse Scheduler Superconducting
    :return: returned QJob object
    
Default generator for single qubit gates.
Default generator for single qubit gates .
def generate1Q(ham: 'QHamiltonian' = None, cirLine: CircuitLine = None,
               scheduler: 'SchedulerSuperconduct' = None) -> QJob:
    subHam = ham.subSystem(cirLine.qRegIndexList)
    if cirLine.data.name in ['X', 'RX']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=2, targetInfid=0.0001)
    elif cirLine.data.name in ['Y', 'RY']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=2, targetInfid=0.0001)
    elif cirLine.data.name in ['Z', 'S', 'T', 'RZ']:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=4, targetInfid=0.0001)
    elif cirLine.data.name in ['U', "H"]:
        job, inf = opt1q(subHam, cirLine.data.getMatrix(), depth=4, targetInfid=0.0001)
    else:
        raise Error.ArgumentError(f"Unsupported single qubit gate {cirLine.data.name}.")
    print(f"Infidelity of {cirLine.data.name} on qubit {cirLine.qRegIndexList}: {inf}")
    subHam.job = job
    return subHam.outputInverseJob(ham.subSysNum, ham.sysLevel, ham.dt)
def generate1Q ( ham : 'QHamiltonian' = None , cirLine : CircuitLine = None , scheduler : 'SchedulerSuperconduct' = None ) -> QJob : subHam = ham . subSystem ( cirLine . qRegIndexList ) if cirLine . data . name in [ 'X' , 'RX' ] : job , inf = opt1q ( subHam , cirLine . data . getMatrix ( ) , depth = 2 , targetInfid = 0.0001 ) elif cirLine . data . name in [ 'Y' , 'RY' ] : job , inf = opt1q ( subHam , cirLine . data . getMatrix ( ) , depth = 2 , targetInfid = 0.0001 ) elif cirLine . data . name in [ 'Z' , 'S' , 'T' , 'RZ' ] : job , inf = opt1q ( subHam , cirLine . data . getMatrix ( ) , depth = 4 , targetInfid = 0.0001 ) elif cirLine . data . name in [ 'U' , "H" ] : job , inf = opt1q ( subHam , cirLine . data . getMatrix ( ) , depth = 4 , targetInfid = 0.0001 ) else : raise Error . ArgumentError ( f"Unsupported single qubit gate {cirLine.data.name}." ) print ( f"Infidelity of {cirLine.data.name} on qubit {cirLine.qRegIndexList}: {inf}" ) subHam . job = job return subHam . outputInverseJob ( ham . subSysNum , ham . sysLevel , ham . dt )
Default generator for single qubit gates.
Default generator for single qubit gates .
"""
    Default generator for single qubit gates.

    :param ham: QHam object containing the system information
    :param cirLine: a CircuitLine object containing the gate information
    :param scheduler: the instance of Quanlse Scheduler Superconducting
    :return: returned QJob object
    """
returned QJob object
returned QJob object
ham
'QHamiltonian'
QHam object containing the system information
QHam object containing the system information
cirLine
CircuitLine
a CircuitLine object containing the gate information
a CircuitLine object containing the gate information
scheduler
'SchedulerSuperconduct'
the instance of Quanlse Scheduler Superconducting
the instance of Quanlse Scheduler Superconducting