def _setup_target_models(self): self.available_lattices_by_name = { k: topology_predefined.__getattribute__(k) for k in self.lattice_names } self.available_lattices = [ topology_predefined.__getattribute__(k) for k in self.lattice_names ] if self.shared_true_parameters: lattice_idx = -1 else: lattice_idx = self.qmla_id % len(self.available_lattices) self.log_print( ["true model set by lattice idx = {}".format(lattice_idx)]) # Rerunning subset with more resources # lattice_idx = self.qmla_id % len(self.rerun_lattices) self.true_lattice_name = self.lattice_names[lattice_idx] # self.true_lattice_name = '_4_site_lattice_fully_connected' self.true_lattice = self.available_lattices_by_name[ self.true_lattice_name] self.true_model = self.model_from_lattice(self.true_lattice) self.max_num_models_by_shape = { 1: 2, 2: 2, 3: 2, 4: 2, 5: 2, 6: 2, "other": 0 } self.num_processes_to_parallelise_over = len(self.available_lattices)
def __init__(self, exploration_rules, **kwargs): self.base_terms = ["z"] self.transverse_field = "x" super().__init__(exploration_rules=exploration_rules, **kwargs) # self.latex_string_map_subroutine = qmla.shared_functionality.latex_model_names.lattice_pauli_likewise_concise self.true_lattice_name = "_3_site_chain_fully_connected" self.true_lattice = topologies.__getattribute__(self.true_lattice_name) self.true_model = self.model_from_lattice(self.true_lattice)
def setup_models(self): self.available_lattices_by_name = { k : topology_predefined.__getattribute__(k) for k in self.lattice_names } self.available_lattices = [ topology_predefined.__getattribute__(k) for k in self.lattice_names ] if self._shared_true_parameters: lattice_idx = -1 else: lattice_idx = self.qmla_id % len(self.available_lattices) self.true_lattice_name = self.lattice_names[ lattice_idx ] self.true_lattice = self.available_lattices_by_name[self.true_lattice_name] self.true_model = self.model_from_lattice(self.true_lattice) # self.log_print(["QMLA {} using lattice {} (lattice idx {}) has model {}".format(self.qmla_id, self.true_lattice_name, lattice_idx, self.true_model)]) self.max_num_qubits = 8 self.max_num_probe_qubits = 8 self.qhl_models = [ self.model_from_lattice(l) for l in self.available_lattices ] self.quantisation = 'first' # 'second if self.quantisation == 'first': # probe transformer between formalisms - not used currently self.probe_transformer = qmla.shared_functionality.probe_transformer.ProbeTransformation() self.system_probes_generation_subroutine = qmla.shared_functionality.probe_set_generation.separable_probe_dict elif self.quantisation == 'second': # Default for FH self.probe_transformer = qmla.shared_functionality.probe_transformer.ProbeTransformation() self.system_probes_generation_subroutine = qmla.shared_functionality.probe_set_generation.separable_fermi_hubbard_half_filled # TODO plot probe dict with meaningful probes wrt FH model self.plot_probes_generation_subroutine = qmla.shared_functionality.probe_set_generation.plus_probes_dict self.num_sites_true = construct_models.get_num_qubits(self.true_model) self.num_qubits_true = 2*self.num_sites_true # FH uses 2 qubits per sites (up and down spin) self.num_probes = 25 self.max_time_to_consider = 25 self.max_num_qubits = 8 self.max_num_probe_qubits = self.max_num_qubits self.latex_string_map_subroutine = qmla.shared_functionality.latex_model_names.lattice_set_fermi_hubbard # self.timing_insurance_factor = 0.8 self.min_param = 0.25 self.max_param = 0.75 self.true_model_terms_params = { # 3 sites # 'FH-hopping-sum_down_1h2_2h3_d3' : 0.25, # 'FH-hopping-sum_up_1h2_2h3_d3' : 0.75, # 'FH-onsite-sum_1_2_3_d3': 0.55, # 2 sites 'FH-hopping-sum_down_1h2_d2' : 0.25, 'FH-hopping-sum_up_1h2_d2' : 0.75, 'FH-onsite-sum_1_2_d2': 0.55, }
def __init__(self, exploration_rules, true_model=None, **kwargs): if true_model is not None: self.true_model = true_model print("[LatticeSet] got true model {}".format(self.true_model)) super().__init__(exploration_rules=exploration_rules, true_model=true_model, **kwargs) self._shared_true_parameters = False self.tree_completed_initially = True # fixed lattice set considered # self.base_terms = ['x', 'z'] # self.transverse_field = None self.latex_string_map_subroutine = qmla.shared_functionality.latex_model_names.lattice_set_grouped_pauli self.initial_models = None # so that QMLA will call generate_models first # self.true_model = self.model_from_lattice(self.available_lattices[0]) self.max_time_to_consider = 45 self.check_champion_reducibility = False self.fraction_own_experiments_for_bf = 0.25 self.fraction_opponents_experiments_for_bf = self.fraction_own_experiments_for_bf self.fraction_particles_for_bf = 0.25 self.lattice_names = [ '_2_site_chain', '_3_site_chain', '_4_site_chain', '_5_site_chain', '_6_site_chain', '_3_site_lattice_fully_connected', '_4_site_lattice_fully_connected', '_5_site_lattice_fully_connected', '_4_site_square', '_6_site_grid' ] # self.rerun_lattices = [ # '_5_site_lattice_fully_connected', # '_6_site_grid' # ] # self.lattice_names = list(sorted(self.available_lattices_by_name.keys())) self.available_lattices_by_name = { k: topology_predefined.__getattribute__(k) for k in self.lattice_names } self.available_lattices = [ topology_predefined.__getattribute__(k) for k in self.lattice_names ] # self.true_lattice = topology_predefined._4_site_square # randomly select a true model from the available lattices if self._shared_true_parameters: lattice_idx = -1 else: lattice_idx = self.qmla_id % len(self.available_lattices) # Rerunning subset with more resources # lattice_idx = self.qmla_id % len(self.rerun_lattices) # self.true_lattice_name = self.lattice_names[ lattice_idx ] self.true_lattice_name = '_4_site_lattice_fully_connected' self.true_lattice = self.available_lattices_by_name[ self.true_lattice_name] self.true_model = self.model_from_lattice(self.true_lattice) self.max_num_models_by_shape = { 1: 2, 2: 2, 3: 2, 4: 2, 5: 2, 6: 2, 'other': 0 } self.num_processes_to_parallelise_over = len(self.available_lattices)