Quanlse/Simulator/PulseSimQCQ.py
def dressedQubitFreq(obj: Union[PulseModel, QHamiltonian]) -> Dict:
    """
    Return the dressed frequencies of the control qubit and the target qubit

    :param obj: input a PulseModel object or QHamiltonian object

    :return: dressed frequencies dictionary
    """
    if isinstance(obj, PulseModel):
        ham = obj.createQHamiltonian(frameMode='lab')
    elif isinstance(obj, QHamiltonian):
        ham = obj
    else:
        raise Error.ArgumentError("Pleases input a PulseModel object or a QHamiltonian object.")

    if ham.sysLevel == [3, 4, 4]:

        ham.buildCache()
        matQCQ = copy.deepcopy(ham.driftCache)

        # Create Qubit-Qubit subspace basis vectors
        vec00 = tensor(basis(3, 0), basis(4, 0), basis(4, 0))
        vec01 = tensor(basis(3, 0), basis(4, 0), basis(4, 1))
        vec10 = tensor(basis(3, 0), basis(4, 1), basis(4, 0))
        vec11 = tensor(basis(3, 0), basis(4, 1), basis(4, 1))

        # Get the eigen system of QCQ Hamiltonian
        originEigenVals, originEigenVecs = eigenSystem(matQCQ)

        # Vector indexes of QQ eigenvectors
        idx00 = findIndex(originEigenVecs, [vec00])[0]
        idx10 = findIndex(originEigenVecs, [vec10])[0]
        idx01 = findIndex(originEigenVecs, [vec01])[0]
        idx11 = findIndex(originEigenVecs, [vec11])[0]

        dressedCtrlFreq = (originEigenVals[idx10] - originEigenVals[idx00]
                           + originEigenVals[idx11] - originEigenVals[idx01]) / 2

        dressedTargetFreq = (originEigenVals[idx11] - originEigenVals[idx10]
                             + originEigenVals[idx01] - originEigenVals[idx00]) / 2

        dressedFreqDict = {
            "control": dressedCtrlFreq,
            "target": dressedTargetFreq
        }

    else:
        raise Error.ArgumentError("Coupler (index: 0) level should be 3 and Qubit (index: 1, 2) level should be 4.")

    return dressedFreqDict

    Return the dressed frequencies of the control qubit and the target qubit

    :param obj: input a PulseModel object or QHamiltonian object

    :return: dressed frequencies dictionary
    
Return the dressed frequencies of the control qubit and the target qubit
Return the dressed frequencies of the control qubit and the target qubit
def dressedQubitFreq(obj: Union[PulseModel, QHamiltonian]) -> Dict:
    if isinstance(obj, PulseModel):
        ham = obj.createQHamiltonian(frameMode='lab')
    elif isinstance(obj, QHamiltonian):
        ham = obj
    else:
        raise Error.ArgumentError("Pleases input a PulseModel object or a QHamiltonian object.")
    if ham.sysLevel == [3, 4, 4]:
        ham.buildCache()
        matQCQ = copy.deepcopy(ham.driftCache)
        vec00 = tensor(basis(3, 0), basis(4, 0), basis(4, 0))
        vec01 = tensor(basis(3, 0), basis(4, 0), basis(4, 1))
        vec10 = tensor(basis(3, 0), basis(4, 1), basis(4, 0))
        vec11 = tensor(basis(3, 0), basis(4, 1), basis(4, 1))
        originEigenVals, originEigenVecs = eigenSystem(matQCQ)
        idx00 = findIndex(originEigenVecs, [vec00])[0]
        idx10 = findIndex(originEigenVecs, [vec10])[0]
        idx01 = findIndex(originEigenVecs, [vec01])[0]
        idx11 = findIndex(originEigenVecs, [vec11])[0]
        dressedCtrlFreq = (originEigenVals[idx10] - originEigenVals[idx00]
                           + originEigenVals[idx11] - originEigenVals[idx01]) / 2
        dressedTargetFreq = (originEigenVals[idx11] - originEigenVals[idx10]
                             + originEigenVals[idx01] - originEigenVals[idx00]) / 2
        dressedFreqDict = {
            "control": dressedCtrlFreq,
            "target": dressedTargetFreq
        }
    else:
        raise Error.ArgumentError("Coupler (index: 0) level should be 3 and Qubit (index: 1, 2) level should be 4.")
    return dressedFreqDict
def dressedQubitFreq ( obj : Union [ PulseModel , QHamiltonian ] ) -> Dict : if isinstance ( obj , PulseModel ) : ham = obj . createQHamiltonian ( frameMode = 'lab' ) elif isinstance ( obj , QHamiltonian ) : ham = obj else : raise Error . ArgumentError ( "Pleases input a PulseModel object or a QHamiltonian object." ) if ham . sysLevel == [ 3 , 4 , 4 ] : ham . buildCache ( ) matQCQ = copy . deepcopy ( ham . driftCache ) vec00 = tensor ( basis ( 3 , 0 ) , basis ( 4 , 0 ) , basis ( 4 , 0 ) ) vec01 = tensor ( basis ( 3 , 0 ) , basis ( 4 , 0 ) , basis ( 4 , 1 ) ) vec10 = tensor ( basis ( 3 , 0 ) , basis ( 4 , 1 ) , basis ( 4 , 0 ) ) vec11 = tensor ( basis ( 3 , 0 ) , basis ( 4 , 1 ) , basis ( 4 , 1 ) ) originEigenVals , originEigenVecs = eigenSystem ( matQCQ ) idx00 = findIndex ( originEigenVecs , [ vec00 ] ) [ 0 ] idx10 = findIndex ( originEigenVecs , [ vec10 ] ) [ 0 ] idx01 = findIndex ( originEigenVecs , [ vec01 ] ) [ 0 ] idx11 = findIndex ( originEigenVecs , [ vec11 ] ) [ 0 ] dressedCtrlFreq = ( originEigenVals [ idx10 ] - originEigenVals [ idx00 ] + originEigenVals [ idx11 ] - originEigenVals [ idx01 ] ) / 2 dressedTargetFreq = ( originEigenVals [ idx11 ] - originEigenVals [ idx10 ] + originEigenVals [ idx01 ] - originEigenVals [ idx00 ] ) / 2 dressedFreqDict = { "control" : dressedCtrlFreq , "target" : dressedTargetFreq } else : raise Error . ArgumentError ( "Coupler (index: 0) level should be 3 and Qubit (index: 1, 2) level should be 4." ) return dressedFreqDict
Return the dressed frequencies of the control qubit and the target qubit
Return the dressed frequencies of the control qubit and the target qubit
"""
    Return the dressed frequencies of the control qubit and the target qubit

    :param obj: input a PulseModel object or QHamiltonian object

    :return: dressed frequencies dictionary
    """ # Create Qubit-Qubit subspace basis vectors # Get the eigen system of QCQ Hamiltonian # Vector indexes of QQ eigenvectors
dressed frequencies dictionary
dressed frequencies dictionary
obj
Union[PulseModel, QHamiltonian]
input a PulseModel object or QHamiltonian object
input a PulseModel object or QHamiltonian object