Skip to content

Commit

Permalink
fix: Fix steps attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jul 15, 2024
1 parent e5d458d commit da648a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/boostvqe/models/dbi/double_bracket_evolution_oracles.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class EvolutionOracle:
"""Type of evolution oracle."""

def __post_init__(self):
self.steps = 1
if self.steps is None:
self.steps = 1
"""Number of steps in Trotter-Suzuki discretization."""

def __call__(self, t_duration: float):
Expand All @@ -52,8 +53,7 @@ def circuit(self, t_duration: float):
dt = t_duration / self.steps
return reduce(
Circuit.__add__,
[self.h.circuit(dt)]
* self.steps, # approx of e^{- i t_duration H}
[self.h.circuit(dt)] * self.steps, # approx of e^{- i t_duration H}
)

def inverted(self, duration: float):
Expand Down

0 comments on commit da648a0

Please sign in to comment.