tequila.simulators.simulator_api.compile_objective¶
-
tequila.simulators.simulator_api.
compile_objective
(objective: tequila.objective.objective.Objective, variables: Dict[Variable, RealNumber] = None, backend: str = None, samples: int = None, device: str = None, noise: tequila.circuit.noise.NoiseModel = None, *args, **kwargs) → tequila.objective.objective.Objective[source]¶ Compile an objective to render it callable and return it.
- Parameters
objective (Objective:) – the objective to compile
variables (dict, optional:) – the variables to compile the objective with. Will autogenerate zeros for all variables if not supplied.
backend (str, optional:) – the backend to compile the objective to.
samples (int, optional:) – only matters if not None; compile the objective for sampling/verify backend can do so
device (optional:) – the device on which the objective should (perhaps emulatedly) sample.
noise (str or NoiseModel, optional:) – the noise to apply to all circuits in the objective.
args –
kwargs –
- Returns
the compiled objective.
- Return type
Objective