Quanlse/Calibration/SingleQubit.py
def qubitSpec(pulseModel: PulseModel, freqRange: list, sample: int, amp: float, t: float) -> [list, list]:
    """
    Qubit Spectroscopy. This function finds the qubit frequency by scanning the pulse frequency
    from a user-defined range.

    :param pulseModel: a pulseModel type object
    :param freqRange: a list of LO frequency's range
    :param sample: how many samples to scan within the freqRange
    :param amp: pulse amplitude (preferably Pi-pulse amp)
    :param t: pulse length (preferably Pi-pulse length)
    :return: a list of pulse frequency scanned and a list of population
    """

    # define pulse frequency list
    freqList = linspace(freqRange[0], freqRange[1], sample)

    # initialize job list
    QSpecJob = pulseModel.ham.createJobList()
    for freq in freqList:
        job = pulseModel.ham.createJob()
        job.setLO(driveX(3), 0, freq=freq)
        job.appendWave(driveX, 0, gaussian(t=t, a=amp, tau=t / 2, sigma=t / 8))
        QSpecJob.addJob(job)

    # run simulation and obtain populations from results
    stateInit = basis(3, 0)
    popList = []
    results = pulseModel.ham.simulate(jobList=QSpecJob, state0=stateInit)
    for result in results:
        rho = result['state']
        prj = basis(3, 1) @ dagger(basis(3, 1))
        popList.append(expect(prj, rho))
    return list(freqList), popList

    Qubit Spectroscopy. This function finds the qubit frequency by scanning the pulse frequency
    from a user-defined range.

    :param pulseModel: a pulseModel type object
    :param freqRange: a list of LO frequency's range
    :param sample: how many samples to scan within the freqRange
    :param amp: pulse amplitude (preferably Pi-pulse amp)
    :param t: pulse length (preferably Pi-pulse length)
    :return: a list of pulse frequency scanned and a list of population
    
Qubit Spectroscopy. This function finds the qubit frequency by scanning the pulse frequency
from a user-defined range.
Qubit Spectroscopy . This function finds the qubit frequency by scanning the pulse frequency from a user - defined range .
def qubitSpec(pulseModel: PulseModel, freqRange: list, sample: int, amp: float, t: float) -> [list, list]:
    freqList = linspace(freqRange[0], freqRange[1], sample)
    QSpecJob = pulseModel.ham.createJobList()
    for freq in freqList:
        job = pulseModel.ham.createJob()
        job.setLO(driveX(3), 0, freq=freq)
        job.appendWave(driveX, 0, gaussian(t=t, a=amp, tau=t / 2, sigma=t / 8))
        QSpecJob.addJob(job)
    stateInit = basis(3, 0)
    popList = []
    results = pulseModel.ham.simulate(jobList=QSpecJob, state0=stateInit)
    for result in results:
        rho = result['state']
        prj = basis(3, 1) @ dagger(basis(3, 1))
        popList.append(expect(prj, rho))
    return list(freqList), popList
def qubitSpec ( pulseModel : PulseModel , freqRange : list , sample : int , amp : float , t : float ) -> [ list , list ] : freqList = linspace ( freqRange [ 0 ] , freqRange [ 1 ] , sample ) QSpecJob = pulseModel . ham . createJobList ( ) for freq in freqList : job = pulseModel . ham . createJob ( ) job . setLO ( driveX ( 3 ) , 0 , freq = freq ) job . appendWave ( driveX , 0 , gaussian ( t = t , a = amp , tau = t / 2 , sigma = t / 8 ) ) QSpecJob . addJob ( job ) stateInit = basis ( 3 , 0 ) popList = [ ] results = pulseModel . ham . simulate ( jobList = QSpecJob , state0 = stateInit ) for result in results : rho = result [ 'state' ] prj = basis ( 3 , 1 ) @ dagger ( basis ( 3 , 1 ) ) popList . append ( expect ( prj , rho ) ) return list ( freqList ) , popList
Qubit Spectroscopy.
Qubit Spectroscopy .
"""
    Qubit Spectroscopy. This function finds the qubit frequency by scanning the pulse frequency
    from a user-defined range.

    :param pulseModel: a pulseModel type object
    :param freqRange: a list of LO frequency's range
    :param sample: how many samples to scan within the freqRange
    :param amp: pulse amplitude (preferably Pi-pulse amp)
    :param t: pulse length (preferably Pi-pulse length)
    :return: a list of pulse frequency scanned and a list of population
    """ # define pulse frequency list # initialize job list # run simulation and obtain populations from results
a list of pulse frequency scanned and a list of population
a list of pulse frequency scanned and a list of population
pulseModel
PulseModel
a pulseModel type object
a pulseModel type object
freqRange
list
a list of LO frequency's range
a list of LO frequency ' s range
sample
int
None
amp
float
pulse amplitude (preferably Pi-pulse amp)
pulse amplitude ( preferably Pi - pulse amp )
t
float
pulse length (preferably Pi-pulse length)
pulse length ( preferably Pi - pulse length )