Quanlse/Scheduler/Ion/DefaultPulseGenerator.py
def generateIon1Qubit(cirLine: CircuitLine = None, scheduler: 'SchedulerIon' = None) -> QJob:
    """
    Default generator for ion single-qubit gates.

    :param cirLine: input circuit line object
    :param scheduler: input scheduler object
    :return: a returned QJob object
    """
    job = QJob(subSysNum=scheduler.subSysNum, sysLevel=2, dt=scheduler.dt)
    qLabel = cirLine.qRegIndexList
    matrixNumber = cirLine.data.getMatrix()
    theta = arccos(matrixNumber[0][0])
    theta = theta.real
    if cirLine.data.name == 'X':
        amp, inf, ureal = opt1q("ionRx", pi, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'Y':
        amp, inf, ureal = opt1q("ionRy", pi, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'RX':
        amp, inf, ureal = opt1q("ionRx", theta, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'RY':
        amp, inf, ureal = opt1q("ionRy", theta, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    else:
        raise Error.ArgumentError(f"Unsupported single-qubit gate {cirLine.data.name}.")

    return job

    Default generator for ion single-qubit gates.

    :param cirLine: input circuit line object
    :param scheduler: input scheduler object
    :return: a returned QJob object
    
Default generator for ion single-qubit gates.
Default generator for ion single - qubit gates .
def generateIon1Qubit(cirLine: CircuitLine = None, scheduler: 'SchedulerIon' = None) -> QJob:
    job = QJob(subSysNum=scheduler.subSysNum, sysLevel=2, dt=scheduler.dt)
    qLabel = cirLine.qRegIndexList
    matrixNumber = cirLine.data.getMatrix()
    theta = arccos(matrixNumber[0][0])
    theta = theta.real
    if cirLine.data.name == 'X':
        amp, inf, ureal = opt1q("ionRx", pi, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'Y':
        amp, inf, ureal = opt1q("ionRy", pi, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'RX':
        amp, inf, ureal = opt1q("ionRx", theta, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    elif cirLine.data.name == 'RY':
        amp, inf, ureal = opt1q("ionRy", theta, scheduler.dt)
        print(f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}")
        job.addWave(uWave, onSubSys=qLabel[0], waves=QWaveform(t0=0.0, t=2 * scheduler.dt, seq=[amp, 0]))
    else:
        raise Error.ArgumentError(f"Unsupported single-qubit gate {cirLine.data.name}.")
    return job
def generateIon1Qubit ( cirLine : CircuitLine = None , scheduler : 'SchedulerIon' = None ) -> QJob : job = QJob ( subSysNum = scheduler . subSysNum , sysLevel = 2 , dt = scheduler . dt ) qLabel = cirLine . qRegIndexList matrixNumber = cirLine . data . getMatrix ( ) theta = arccos ( matrixNumber [ 0 ] [ 0 ] ) theta = theta . real if cirLine . data . name == 'X' : amp , inf , ureal = opt1q ( "ionRx" , pi , scheduler . dt ) print ( f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}" ) job . addWave ( uWave , onSubSys = qLabel [ 0 ] , waves = QWaveform ( t0 = 0.0 , t = 2 * scheduler . dt , seq = [ amp , 0 ] ) ) elif cirLine . data . name == 'Y' : amp , inf , ureal = opt1q ( "ionRy" , pi , scheduler . dt ) print ( f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}" ) job . addWave ( uWave , onSubSys = qLabel [ 0 ] , waves = QWaveform ( t0 = 0.0 , t = 2 * scheduler . dt , seq = [ amp , 0 ] ) ) elif cirLine . data . name == 'RX' : amp , inf , ureal = opt1q ( "ionRx" , theta , scheduler . dt ) print ( f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}" ) job . addWave ( uWave , onSubSys = qLabel [ 0 ] , waves = QWaveform ( t0 = 0.0 , t = 2 * scheduler . dt , seq = [ amp , 0 ] ) ) elif cirLine . data . name == 'RY' : amp , inf , ureal = opt1q ( "ionRy" , theta , scheduler . dt ) print ( f"Single gate infidelity on qubit {qLabel[0]} is: \n {inf}" ) job . addWave ( uWave , onSubSys = qLabel [ 0 ] , waves = QWaveform ( t0 = 0.0 , t = 2 * scheduler . dt , seq = [ amp , 0 ] ) ) else : raise Error . ArgumentError ( f"Unsupported single-qubit gate {cirLine.data.name}." ) return job
Default generator for ion single-qubit gates.
Default generator for ion single - qubit gates .
"""
    Default generator for ion single-qubit gates.

    :param cirLine: input circuit line object
    :param scheduler: input scheduler object
    :return: a returned QJob object
    """
a returned QJob object
a returned QJob object
cirLine
CircuitLine
input circuit line object
input circuit line object
scheduler
'SchedulerIon'
input scheduler object
input scheduler object