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

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param amp: fixed pulse amplitude
    :param tRange: a list of duration bounds
    :param sample: sample size (default at 100)
    :return: a list of pulse duration scanned and a list of populations
    """

    # initialize population list and define time list
    popList = []
    tList = linspace(tRange[0], tRange[1], sample)

    # define job list
    qJobList = pulseModel.ham.createJobList()
    for t in tList:
        qJob = pulseModel.ham.createJob()
        qJob.setLO(driveX, 0, freq=pulseFreq)
        qJob.appendWave(driveX, 0, gaussian(t, amp, t / 2, t / 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(tList), popList

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

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param amp: fixed pulse amplitude
    :param tRange: a list of duration bounds
    :param sample: sample size (default at 100)
    :return: a list of pulse duration scanned and a list of populations
    
Perform a Rabi Oscillation by varying the pulse duration. This function returns a list of pulse duration scanned
and a list of populations.
Perform a Rabi Oscillation by varying the pulse duration . This function returns a list of pulse duration scanned and a list of populations .
def tRabi(pulseModel: PulseModel, pulseFreq: Union[int, float], tRange: list, amp: float,
          sample: int = 100) -> [list, list]:
    popList = []
    tList = linspace(tRange[0], tRange[1], sample)
    qJobList = pulseModel.ham.createJobList()
    for t in tList:
        qJob = pulseModel.ham.createJob()
        qJob.setLO(driveX, 0, freq=pulseFreq)
        qJob.appendWave(driveX, 0, gaussian(t, amp, t / 2, t / 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(tList), popList
def tRabi ( pulseModel : PulseModel , pulseFreq : Union [ int , float ] , tRange : list , amp : float , sample : int = 100 ) -> [ list , list ] : popList = [ ] tList = linspace ( tRange [ 0 ] , tRange [ 1 ] , sample ) qJobList = pulseModel . ham . createJobList ( ) for t in tList : qJob = pulseModel . ham . createJob ( ) qJob . setLO ( driveX , 0 , freq = pulseFreq ) qJob . appendWave ( driveX , 0 , gaussian ( t , amp , t / 2 , t / 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 ( tList ) , popList
Perform a Rabi Oscillation by varying the pulse duration.
Perform a Rabi Oscillation by varying the pulse duration .
"""
    Perform a Rabi Oscillation by varying the pulse duration. This function returns a list of pulse duration scanned
    and a list of populations.

    :param pulseModel: a pulseModel object
    :param pulseFreq: frequency of the pulse
    :param amp: fixed pulse amplitude
    :param tRange: a list of duration bounds
    :param sample: sample size (default at 100)
    :return: a list of pulse duration scanned and a list of populations
    """ # initialize population list and define time list # define job list # run simulation # obtain population from results
a list of pulse duration scanned and a list of populations
a list of pulse duration 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
tRange
list
a list of duration bounds
a list of duration bounds
amp
float
fixed pulse amplitude
fixed pulse amplitude
sample
int
sample size (default at 100)
sample size ( default at 100 )