Skip to content

Add resource estimation notebook for trotterized QPE #753

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

Merged
merged 7 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qualtran/bloqs/chemistry/trotter/hubbard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
where $z_{p\sigma} = (2 n_{p\sigma} - 1)$.


For Trotterization we assume the plaquette splitting from the
For Trotterization we assume the plaquette splitting from the
[reference](https://arxiv.org/abs/2012.09238).
The plaquette splitting rewrites $H_h$ as a sum of $H_h^p$ and $H_h^g$ (for pink and gold
The plaquette splitting rewrites $H_h$ as a sum of $H_h^p$ and $H_h^g$ (for pink and gold
respectively) which when combined tile the entire lattice. Each plaquette
contains four sites and paritions the lattice such that each edge of the lattice
belongs to a single plaquette. Each term within a grouping commutes so that the
Expand Down
14 changes: 8 additions & 6 deletions qualtran/bloqs/chemistry/trotter/hubbard/hopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class HoppingPlaquette(Bloq):
$$
\sum_{i,j} [R_{\mathrm{plaq}}]_{i,j} a_{i\sigma}^\dagger a_{j\sigma}
$$
where the non-zero sub-bloq of R_{\mathrm{plaq}} is
where the non-zero sub-bloq of $R_{\mathrm{plaq}}$ is

$$
R_{\mathrm{plaq}} =
R_{\mathrm{plaq}} =
\begin{bmatrix}
0 & 1 & 0 & 1 \\
1 & 0 & 1 & 0 \\
Expand All @@ -55,7 +55,7 @@ class HoppingPlaquette(Bloq):

Args:
kappa: The scalar prefactor appearing in the definition of the unitary.
Usually a combination of the timestep and the hopping parameter $\tau$.
Usually a combination of the timestep and the hopping parameter $\tau$.
eps: The precision of the single qubit rotations.

Registers:
Expand All @@ -78,7 +78,7 @@ def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
# page 14, discussion after E13
# There are 4 flanking f-gates and a e^{iXX}e^{iYY} rotation, which can
# be rotated to single rotation + cliffords.
return {(TwoBitFFFT(0, 1), 4), (Rz(self.kappa, eps=self.eps), 2)}
return {(TwoBitFFFT(0, 1, eps=self.eps), 4), (Rz(self.kappa, eps=self.eps), 2)}


@frozen
Expand Down Expand Up @@ -116,7 +116,7 @@ class HoppingTile(Bloq):
pink: bool = True

def __attrs_post_init__(self):
if self.length % 2 != 0:
if isinstance(self.length, int) and self.length % 2 != 0:
raise ValueError('Only even length lattices are supported')

def short_name(self) -> str:
Expand All @@ -129,7 +129,9 @@ def signature(self) -> Signature:

def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
# Page 5, text after Eq. 22. There are L^2 / 4 plaquettes of a given colour and x2 for spin.
return {(HoppingPlaquette(kappa=self.tau * self.angle, eps=self.eps), self.length**2 // 2)}
return {
(HoppingPlaquette(kappa=self.tau * self.angle, eps=self.eps), self.length**2 // 2)
}


@bloq_example
Expand Down
Loading