Quanlse/Simulator/__init__.py
def createQHamiltonian(self, frameMode: str = "rot") -> QHamiltonian:
        r"""
        Generate a QHamiltonian object based on the physics model and a QJob object.

        :param frameMode: the rotating frame we choose. The default setting is rotating frame being in the qubits
            frequencies.
        :return: a QHamiltonian object.
        """

        # Initialize the hamiltonian
        ham = QHamiltonian(subSysNum=self.subSysNum, sysLevel=self.sysLevel, dt=self.dt)

        # Create the system Hamiltonian in the lab frame
        if frameMode == "lab":
            # Create the system Hamiltonian in the lab frame
            self._generateDrift(ham, frameMode='lab')
            if self.couplingMap is not None:
                self._generateTimeIndepCoupTerm(ham)
            self._setDecoherence(ham)
        elif frameMode == "rot":
            # Create the system Hamiltonian in the rotating frame of qubit frequency
            self._generateDrift(ham)
            self._setDecoherence(ham)
            if self.couplingMap is not None:
                self._generateCoupTerm(ham)
        else:
            raise Error.ArgumentError(f"Unsupported frameMode {frameMode}, only 'lab' and 'rot' are supported.")

        self.ham = ham

        if self._driveFreq is not None:
            # Set the local oscillator
            for qIdx in self._driveFreq.keys():
                self.ham.job.setLO(uWave, qIdx, freq=self._driveFreq[qIdx])

        if self._pulseGeneratorFunc is not None:
            self._pulseGenerator = self._pulseGeneratorFunc(self.ham)

        return self.ham
r"""
        Generate a QHamiltonian object based on the physics model and a QJob object.

        :param frameMode: the rotating frame we choose. The default setting is rotating frame being in the qubits
            frequencies.
        :return: a QHamiltonian object.
        
r"""
Generate a QHamiltonian object based on the physics model and a QJob object.
r " " " Generate a QHamiltonian object based on the physics model and a QJob object .
def createQHamiltonian(self, frameMode: str = "rot") -> QHamiltonian:
        ham = QHamiltonian(subSysNum=self.subSysNum, sysLevel=self.sysLevel, dt=self.dt)
        if frameMode == "lab":
            self._generateDrift(ham, frameMode='lab')
            if self.couplingMap is not None:
                self._generateTimeIndepCoupTerm(ham)
            self._setDecoherence(ham)
        elif frameMode == "rot":
            self._generateDrift(ham)
            self._setDecoherence(ham)
            if self.couplingMap is not None:
                self._generateCoupTerm(ham)
        else:
            raise Error.ArgumentError(f"Unsupported frameMode {frameMode}, only 'lab' and 'rot' are supported.")
        self.ham = ham
        if self._driveFreq is not None:
            for qIdx in self._driveFreq.keys():
                self.ham.job.setLO(uWave, qIdx, freq=self._driveFreq[qIdx])
        if self._pulseGeneratorFunc is not None:
            self._pulseGenerator = self._pulseGeneratorFunc(self.ham)
        return self.ham
def createQHamiltonian ( self , frameMode : str = "rot" ) -> QHamiltonian : ham = QHamiltonian ( subSysNum = self . subSysNum , sysLevel = self . sysLevel , dt = self . dt ) if frameMode == "lab" : self . _generateDrift ( ham , frameMode = 'lab' ) if self . couplingMap is not None : self . _generateTimeIndepCoupTerm ( ham ) self . _setDecoherence ( ham ) elif frameMode == "rot" : self . _generateDrift ( ham ) self . _setDecoherence ( ham ) if self . couplingMap is not None : self . _generateCoupTerm ( ham ) else : raise Error . ArgumentError ( f"Unsupported frameMode {frameMode}, only 'lab' and 'rot' are supported." ) self . ham = ham if self . _driveFreq is not None : for qIdx in self . _driveFreq . keys ( ) : self . ham . job . setLO ( uWave , qIdx , freq = self . _driveFreq [ qIdx ] ) if self . _pulseGeneratorFunc is not None : self . _pulseGenerator = self . _pulseGeneratorFunc ( self . ham ) return self . ham
r"""
Generate a QHamiltonian object based on the physics model and a QJob object.
r " " " Generate a QHamiltonian object based on the physics model and a QJob object .
r"""
        Generate a QHamiltonian object based on the physics model and a QJob object.

        :param frameMode: the rotating frame we choose. The default setting is rotating frame being in the qubits
            frequencies.
        :return: a QHamiltonian object.
        """ # Initialize the hamiltonian # Create the system Hamiltonian in the lab frame # Create the system Hamiltonian in the lab frame # Create the system Hamiltonian in the rotating frame of qubit frequency # Set the local oscillator
a QHamiltonian object.
a QHamiltonian object .
self
frameMode
str
the rotating frame we choose. The default setting is rotating frame being in the qubits
frequencies.
the rotating frame we choose . The default setting is rotating frame being in the qubits frequencies .