From c6da8c5d4ee02a3b3f765323dadde7d73034ef3f Mon Sep 17 00:00:00 2001 From: Marek Gluza Date: Wed, 17 Jul 2024 17:11:54 +0800 Subject: [PATCH] pseudo code for what is to be done --- .../dbi/double_bracket_evolution_oracles.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/boostvqe/models/dbi/double_bracket_evolution_oracles.py b/src/boostvqe/models/dbi/double_bracket_evolution_oracles.py index 7740df6..1c41e5b 100644 --- a/src/boostvqe/models/dbi/double_bracket_evolution_oracles.py +++ b/src/boostvqe/models/dbi/double_bracket_evolution_oracles.py @@ -264,6 +264,35 @@ def circuit(self, t): return circuit +############################################## +#pseudocode follows +@dataclass +class HamiltonianSimulation_EvolutionOracle(EvolutionOracle): + steps: int = None + order: int = None + delta: float = 0.5 + + @classmethod + def from_symbolic_hamiltonian(cls, h): + + hamiltonian = h + ... + return cls( + h=hamiltonian, + evolution_oracle_type=EvolutionOracleType.hamiltonian_simulation, + **kwargs, + ) + + def circuit(self, t_duration, steps=None, order=None): + c=self.h.circuit(dt) + for g in c.queue: + if g is two qubit + new_gate_list_add(two_qubit_decomposition(g) + c_recompiled_into_CNOT = ...collect...decompositions here + + return reduce(__add__,c_recompiled_dt) #cf XXZ compiling + + @dataclass class XXZ_EvolutionOracle(EvolutionOracle): steps: int = None