Quanlse/Calibration/SingleQubit.py
def ampRabi(pulseModel: PulseModel, pulseFreq: Union[int, float], ampRange: list, tg: int,
            sample: int = 100) -> [list, list]:
    """
    Perform a Rabi Oscillation by varying the pulse amplitudes. This function returns a list of amplitudes scanned
    and a list of populations.

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param ampRange: a list of amplitude bounds
    :param tg: fixed pulse duration
    :param sample: sample size (default at 100)
    :return: a list of amplitudes scanned and a list of populations
    """
    # initialize population list and define amplitude list
    popList = []
    ampList = linspace(ampRange[0], ampRange[1], sample)

    # define job list
    qJobList = pulseModel.ham.createJobList()
    for amp in ampList:
        qJob = pulseModel.ham.createJob()
        qJob.setLO(driveX, 0, freq=pulseFreq)
        qJob.appendWave(driveX, 0, gaussian(tg, amp, tg / 2, tg / 8))
        qJobList.addJob(qJob)
    stateInit = basis(3, 0)

    # run simulation
    results = pulseModel.ham.simulate(jobList=qJobList, state0=stateInit)

    # obtain population from results
    for result in results:
        rho = result['state']
        prj = basis(3, 1) @ dagger(basis(3, 1))
        popList.append(expect(prj, rho))
    return list(ampList), popList

    Perform a Rabi Oscillation by varying the pulse amplitudes. This function returns a list of amplitudes scanned
    and a list of populations.

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param ampRange: a list of amplitude bounds
    :param tg: fixed pulse duration
    :param sample: sample size (default at 100)
    :return: a list of amplitudes scanned and a list of populations
    
Perform a Rabi Oscillation by varying the pulse amplitudes. This function returns a list of amplitudes scanned
and a list of populations.
Perform a Rabi Oscillation by varying the pulse amplitudes . This function returns a list of amplitudes scanned and a list of populations .
def ampRabi(pulseModel: PulseModel, pulseFreq: Union[int, float], ampRange: list, tg: int,
            sample: int = 100) -> [list, list]:
    popList = []
    ampList = linspace(ampRange[0], ampRange[1], sample)
    qJobList = pulseModel.ham.createJobList()
    for amp in ampList:
        qJob = pulseModel.ham.createJob()
        qJob.setLO(driveX, 0, freq=pulseFreq)
        qJob.appendWave(driveX, 0, gaussian(tg, amp, tg / 2, tg / 8))
        qJobList.addJob(qJob)
    stateInit = basis(3, 0)
    results = pulseModel.ham.simulate(jobList=qJobList, state0=stateInit)
    for result in results:
        rho = result['state']
        prj = basis(3, 1) @ dagger(basis(3, 1))
        popList.append(expect(prj, rho))
    return list(ampList), popList
def ampRabi ( pulseModel : PulseModel , pulseFreq : Union [ int , float ] , ampRange : list , tg : int , sample : int = 100 ) -> [ list , list ] : popList = [ ] ampList = linspace ( ampRange [ 0 ] , ampRange [ 1 ] , sample ) qJobList = pulseModel . ham . createJobList ( ) for amp in ampList : qJob = pulseModel . ham . createJob ( ) qJob . setLO ( driveX , 0 , freq = pulseFreq ) qJob . appendWave ( driveX , 0 , gaussian ( tg , amp , tg / 2 , tg / 8 ) ) qJobList . addJob ( qJob ) stateInit = basis ( 3 , 0 ) results = pulseModel . ham . simulate ( jobList = qJobList , state0 = stateInit ) for result in results : rho = result [ 'state' ] prj = basis ( 3 , 1 ) @ dagger ( basis ( 3 , 1 ) ) popList . append ( expect ( prj , rho ) ) return list ( ampList ) , popList
Perform a Rabi Oscillation by varying the pulse amplitudes.
Perform a Rabi Oscillation by varying the pulse amplitudes .
"""
    Perform a Rabi Oscillation by varying the pulse amplitudes. This function returns a list of amplitudes scanned
    and a list of populations.

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param ampRange: a list of amplitude bounds
    :param tg: fixed pulse duration
    :param sample: sample size (default at 100)
    :return: a list of amplitudes scanned and a list of populations
    """ # initialize population list and define amplitude list # define job list # run simulation # obtain population from results
a list of amplitudes scanned and a list of populations
a list of amplitudes scanned and a list of populations
pulseModel
PulseModel
a pulseModel object
a pulseModel object
pulseFreq
Union[int, float]
frequency of the pulse
frequency of the pulse
ampRange
list
a list of amplitude bounds
a list of amplitude bounds
tg
int
fixed pulse duration
fixed pulse duration
sample
int
sample size (default at 100)
sample size ( default at 100 )