Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SymbolicHamiltonianEvolutionOracle #69

Open
6 tasks
marekgluza opened this issue Jul 17, 2024 · 0 comments
Open
6 tasks

SymbolicHamiltonianEvolutionOracle #69

marekgluza opened this issue Jul 17, 2024 · 0 comments
Assignees

Comments

@marekgluza
Copy link
Contributor

marekgluza commented Jul 17, 2024

  • Please fill in the pseudocode structure

    ##############################################
    #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

  • key is to use something like this on h.circuit(dt)

import qibo
from qibo.symbols import *

from qibo.hamiltonians import SymbolicHamiltonian
from qibo.transpiler.unitary_decompositions import two_qubit_decomposition

nqubits = 2
delta = 0.5
hamiltonian = SymbolicHamiltonian(
X(0)*X(1)+Z(0)
,
nqubits=nqubits,
)

for g in hamiltonian.circuit(0.1).queue:
    two_qubit_decomposition(0,1,g.matrix())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants