Ejemplo n.º 1
0
 def __init__(self,
              EJ1,
              EJ2,
              EJ3,
              ECJ1,
              ECJ2,
              ECJ3,
              ECg1,
              ECg2,
              ng1,
              ng2,
              flux,
              ncut,
              truncated_dim=None):
     self.EJ1 = EJ1
     self.EJ2 = EJ2
     self.EJ3 = EJ3
     self.ECJ1 = ECJ1
     self.ECJ2 = ECJ2
     self.ECJ3 = ECJ3
     self.ECg1 = ECg1
     self.ECg2 = ECg2
     self.ng1 = ng1
     self.ng2 = ng2
     self.flux = flux
     self.ncut = ncut
     self.truncated_dim = truncated_dim
     self._sys_type = '3-jct. flux qubit'
     self._evec_dtype = np.complex_
     self._default_grid = Grid1d(-np.pi / 2, 3 * np.pi / 2,
                                 100)  # for plotting in phi_j basis
Ejemplo n.º 2
0
 def __init__(self, EJ, EC, EL, flux, cutoff, truncated_dim=None):
     self.EJ = EJ
     self.EC = EC
     self.EL = EL
     self.flux = flux
     self.cutoff = cutoff
     self.truncated_dim = truncated_dim
     self._sys_type = 'fluxonium'
     self._evec_dtype = np.float_
     self._default_grid = Grid1d(-4.5 * np.pi, 4.5 * np.pi, 151)
Ejemplo n.º 3
0
 def __init__(self, EJ, EC, ng, ncut, truncated_dim=None):
     self.EJ = EJ
     self.EC = EC
     self.ng = ng
     self.ncut = ncut
     self.truncated_dim = truncated_dim
     self._sys_type = 'transmon'
     self._evec_dtype = np.float_
     self._default_grid = Grid1d(-np.pi, np.pi, 151)
     self._default_n_range = (-5, 6)
Ejemplo n.º 4
0
    def create_from_dict(cls, meta_dict):
        """Set object parameters by given metadata dictionary

        Parameters
        ----------
        meta_dict: dict
        """
        filtered_dict = {}
        grid_dict = {}
        for param_name, param_value in meta_dict.items():
            if isinstance(param_value, (int, float, np.number)):
                if param_name in ['min_val', 'max_val', 'pt_count']:
                    grid_dict[param_name] = param_value
                else:
                    filtered_dict[param_name] = param_value
        grid = Grid1d(**grid_dict)
        filtered_dict['grid'] = grid
        return cls(**filtered_dict)
Ejemplo n.º 5
0
    def create_from_dict(cls, meta_dict):
        """Set object parameters by given metadata dictionary

        Parameters
        ----------
        meta_dict: dict
        """
        filtered_dict = {}
        grid_dict = {}
        for param_name, param_value in meta_dict.items():
            if key_in_grid1d(param_name):
                grid_dict[param_name] = param_value
            elif is_numerical(param_value):
                filtered_dict[param_name] = param_value

        grid = Grid1d(**grid_dict)
        filtered_dict['grid'] = grid
        return cls(**filtered_dict)
Ejemplo n.º 6
0
    def __init__(self,
                 EJ,
                 EL,
                 ECJ,
                 EC,
                 ng,
                 flux,
                 grid,
                 ncut,
                 dEJ=0,
                 dCJ=0,
                 ECS=None,
                 truncated_dim=None):
        self.EJ = EJ
        self.EL = EL
        self.ECJ = ECJ

        if EC is None and ECS is None:
            raise ValueError("Argument missing: must either provide EC or ECS")
        if EC and ECS:
            raise ValueError(
                "Argument error: can only provide either EC or ECS")
        if EC:
            self.EC = EC
        else:
            self.EC = 1 / (1 / ECS - 1 / self.ECJ)

        self.dEJ = dEJ
        self.dCJ = dCJ
        self.ng = ng
        self.flux = flux
        self.grid = grid
        self.ncut = ncut
        self.truncated_dim = truncated_dim
        self._sys_type = '0-pi'
        self._evec_dtype = np.complex_
        self._default_grid = Grid1d(
            -np.pi / 2, 3 * np.pi / 2,
            100)  # for theta, needed for plotting wavefunction

        CENTRAL_DISPATCH.register('GRID_UPDATE', self)