Quanlse/Calibration/TwoQubit.py
def czCaliCondPhaseJob(sche: Scheduler, q0: int, q1: int, q0ZAmp: float, q1ZAmp: float, czLen: float):
    """
    Generate the calibration pulses (QJobList instances) for the conditional phase by tuning the Z pulse.

    :param sche: the Scheduler instance
    :param q0: the index of the first qubit to be calibrated
    :param q1: the index of the second qubit to be calibrated
    :param q0ZAmp: the amplitude of Z pulse on the first qubit
    :param q1ZAmp: the amplitude of Z pulse on the second qubit
    :param czLen: the duration of the Z pulse
    :return: the QJobList instance
    """

    qubits = (q0, q1)

    # Set the pulse parameter
    sche.conf["caliDataCZ"][qubits]["q0ZAmp"] = q0ZAmp
    sche.conf["caliDataCZ"][qubits]["q1ZAmp"] = q1ZAmp
    sche.conf["caliDataCZ"][qubits]["czLen"] = czLen
    sche.conf["caliDataCZ"][qubits]["q0VZPhase"] = 0.
    sche.conf["caliDataCZ"][qubits]["q1VZPhase"] = 0.

    # -------------------------------------
    # 1. When qubit B is initialized as |1>
    # -------------------------------------
    sche.clearCircuit()
    # Add the X pulse
    RX(pi / 2)(sche.Q[q0])
    RX(pi)(sche.Q[q1])
    # Add the Z pulse
    CZ(sche.Q[q0], sche.Q[q1])
    # Add the X/2 pulse
    RX(pi / 2)(sche.Q[q0])
    # Generate the pulse
    job1 = sche.schedule()

    # -------------------------------------
    # 2. When qubit B is initialized as |0>
    # -------------------------------------
    sche.clearCircuit()
    # Add the X pulse
    RX(pi / 2)(sche.Q[q0])
    # Add the Z pulse
    CZ(sche.Q[q0], sche.Q[q1])
    # Add the X/2 pulse
    RX(pi / 2)(sche.Q[q0])
    # Generate the pulse
    job2 = sche.schedule()

    # Insert into the jobList
    jobList = sche.ham.createJobList()
    jobList.addJob(job1)
    jobList.addJob(job2)

    return jobList

    Generate the calibration pulses (QJobList instances) for the conditional phase by tuning the Z pulse.

    :param sche: the Scheduler instance
    :param q0: the index of the first qubit to be calibrated
    :param q1: the index of the second qubit to be calibrated
    :param q0ZAmp: the amplitude of Z pulse on the first qubit
    :param q1ZAmp: the amplitude of Z pulse on the second qubit
    :param czLen: the duration of the Z pulse
    :return: the QJobList instance
    
Generate the calibration pulses (QJobList instances) for the conditional phase by tuning the Z pulse.
Generate the calibration pulses ( QJobList instances ) for the conditional phase by tuning the Z pulse .
def czCaliCondPhaseJob(sche: Scheduler, q0: int, q1: int, q0ZAmp: float, q1ZAmp: float, czLen: float):
    qubits = (q0, q1)
    sche.conf["caliDataCZ"][qubits]["q0ZAmp"] = q0ZAmp
    sche.conf["caliDataCZ"][qubits]["q1ZAmp"] = q1ZAmp
    sche.conf["caliDataCZ"][qubits]["czLen"] = czLen
    sche.conf["caliDataCZ"][qubits]["q0VZPhase"] = 0.
    sche.conf["caliDataCZ"][qubits]["q1VZPhase"] = 0.
    sche.clearCircuit()
    RX(pi / 2)(sche.Q[q0])
    RX(pi)(sche.Q[q1])
    CZ(sche.Q[q0], sche.Q[q1])
    RX(pi / 2)(sche.Q[q0])
    job1 = sche.schedule()
    sche.clearCircuit()
    RX(pi / 2)(sche.Q[q0])
    CZ(sche.Q[q0], sche.Q[q1])
    RX(pi / 2)(sche.Q[q0])
    job2 = sche.schedule()
    jobList = sche.ham.createJobList()
    jobList.addJob(job1)
    jobList.addJob(job2)
    return jobList
def czCaliCondPhaseJob ( sche : Scheduler , q0 : int , q1 : int , q0ZAmp : float , q1ZAmp : float , czLen : float ) : qubits = ( q0 , q1 ) sche . conf [ "caliDataCZ" ] [ qubits ] [ "q0ZAmp" ] = q0ZAmp sche . conf [ "caliDataCZ" ] [ qubits ] [ "q1ZAmp" ] = q1ZAmp sche . conf [ "caliDataCZ" ] [ qubits ] [ "czLen" ] = czLen sche . conf [ "caliDataCZ" ] [ qubits ] [ "q0VZPhase" ] = 0. sche . conf [ "caliDataCZ" ] [ qubits ] [ "q1VZPhase" ] = 0. sche . clearCircuit ( ) RX ( pi / 2 ) ( sche . Q [ q0 ] ) RX ( pi ) ( sche . Q [ q1 ] ) CZ ( sche . Q [ q0 ] , sche . Q [ q1 ] ) RX ( pi / 2 ) ( sche . Q [ q0 ] ) job1 = sche . schedule ( ) sche . clearCircuit ( ) RX ( pi / 2 ) ( sche . Q [ q0 ] ) CZ ( sche . Q [ q0 ] , sche . Q [ q1 ] ) RX ( pi / 2 ) ( sche . Q [ q0 ] ) job2 = sche . schedule ( ) jobList = sche . ham . createJobList ( ) jobList . addJob ( job1 ) jobList . addJob ( job2 ) return jobList
Generate the calibration pulses (QJobList instances) for the conditional phase by tuning the Z pulse.
Generate the calibration pulses ( QJobList instances ) for the conditional phase by tuning the Z pulse .
"""
    Generate the calibration pulses (QJobList instances) for the conditional phase by tuning the Z pulse.

    :param sche: the Scheduler instance
    :param q0: the index of the first qubit to be calibrated
    :param q1: the index of the second qubit to be calibrated
    :param q0ZAmp: the amplitude of Z pulse on the first qubit
    :param q1ZAmp: the amplitude of Z pulse on the second qubit
    :param czLen: the duration of the Z pulse
    :return: the QJobList instance
    """ # Set the pulse parameter # ------------------------------------- # 1. When qubit B is initialized as |1> # ------------------------------------- # Add the X pulse # Add the Z pulse # Add the X/2 pulse # Generate the pulse # ------------------------------------- # 2. When qubit B is initialized as |0> # ------------------------------------- # Add the X pulse # Add the Z pulse # Add the X/2 pulse # Generate the pulse # Insert into the jobList
the QJobList instance
the QJobList instance
sche
Scheduler
the Scheduler instance
the Scheduler instance
q0
int
the index of the first qubit to be calibrated
the index of the first qubit to be calibrated
q1
int
the index of the second qubit to be calibrated
the index of the second qubit to be calibrated
q0ZAmp
float
the amplitude of Z pulse on the first qubit
the amplitude of Z pulse on the first qubit
q1ZAmp
float
the amplitude of Z pulse on the second qubit
the amplitude of Z pulse on the second qubit
czLen
float
the duration of the Z pulse
the duration of the Z pulse