Skip to content

Commit a4a0f92

Browse files
authored
Add resource estimation notebook for trotterized QPE (#753)
* Small fixes to hubbard bloqs. * Add cost notebook. * Fix eps type. * Address review comments.
1 parent 57d14d0 commit a4a0f92

7 files changed

Lines changed: 698 additions & 118 deletions

File tree

qualtran/bloqs/chemistry/trotter/hubbard/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
where $z_{p\sigma} = (2 n_{p\sigma} - 1)$.
3636
3737
38-
For Trotterization we assume the plaquette splitting from the
38+
For Trotterization we assume the plaquette splitting from the
3939
[reference](https://arxiv.org/abs/2012.09238).
40-
The plaquette splitting rewrites $H_h$ as a sum of $H_h^p$ and $H_h^g$ (for pink and gold
40+
The plaquette splitting rewrites $H_h$ as a sum of $H_h^p$ and $H_h^g$ (for pink and gold
4141
respectively) which when combined tile the entire lattice. Each plaquette
4242
contains four sites and paritions the lattice such that each edge of the lattice
4343
belongs to a single plaquette. Each term within a grouping commutes so that the

qualtran/bloqs/chemistry/trotter/hubbard/hopping.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class HoppingPlaquette(Bloq):
4141
$$
4242
\sum_{i,j} [R_{\mathrm{plaq}}]_{i,j} a_{i\sigma}^\dagger a_{j\sigma}
4343
$$
44-
where the non-zero sub-bloq of R_{\mathrm{plaq}} is
44+
where the non-zero sub-bloq of $R_{\mathrm{plaq}}$ is
4545
4646
$$
47-
R_{\mathrm{plaq}} =
47+
R_{\mathrm{plaq}} =
4848
\begin{bmatrix}
4949
0 & 1 & 0 & 1 \\
5050
1 & 0 & 1 & 0 \\
@@ -55,7 +55,7 @@ class HoppingPlaquette(Bloq):
5555
5656
Args:
5757
kappa: The scalar prefactor appearing in the definition of the unitary.
58-
Usually a combination of the timestep and the hopping parameter $\tau$.
58+
Usually a combination of the timestep and the hopping parameter $\tau$.
5959
eps: The precision of the single qubit rotations.
6060
6161
Registers:
@@ -78,7 +78,7 @@ def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
7878
# page 14, discussion after E13
7979
# There are 4 flanking f-gates and a e^{iXX}e^{iYY} rotation, which can
8080
# be rotated to single rotation + cliffords.
81-
return {(TwoBitFFFT(0, 1), 4), (Rz(self.kappa, eps=self.eps), 2)}
81+
return {(TwoBitFFFT(0, 1, eps=self.eps), 4), (Rz(self.kappa, eps=self.eps), 2)}
8282

8383

8484
@frozen
@@ -116,7 +116,7 @@ class HoppingTile(Bloq):
116116
pink: bool = True
117117

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

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

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

134136

135137
@bloq_example

0 commit comments

Comments
 (0)