Skip to content

Commit

Permalink
walk op docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
anurudhp committed Apr 27, 2024
1 parent a3a6076 commit 1d1612f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion qualtran/bloqs/qubitization_walk_operator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@
"## `QubitizationWalkOperator`\n",
"Constructs a Szegedy Quantum Walk operator using LCU oracles SELECT and PREPARE.\n",
"\n",
"For a Hamiltonian $H = \\sum_l w_l H_l$ (s.t. $w_l > 0$ and $H_l$ are unitaries),\n",
"Constructs a Szegedy quantum walk operator $W = R_{L} . SELECT$, which is a product of\n",
"two reflections $R_{L} = (2|L><L| - I)$ and $SELECT=\\sum_{l}|l><l|H_{l}$.\n",
"\n",
"The action of $W$ partitions the Hilbert space into a direct sum of two-dimensional irreducible\n",
"vector spaces. For an arbitrary eigenstate $|k>$ of $H$ with eigenvalue $E_k$, $|\\ell>|k>$ and\n",
"an orthogonal state $\\phi_{k}$ span the irreducible two-dimensional space that $|\\ell>|k>$ is\n",
"in under the action of $W$. In this space, $W$ implements a Pauli-Y rotation by an angle of\n",
"$-2arccos(E_{k} / \\lambda)$ s.t. $W = e^{i arccos(E_k / \\lambda) Y}$.\n",
"$-2arccos(E_{k} / \\lambda)$ s.t. $W = e^{i arccos(E_k / \\lambda) Y}$,\n",
"where $\\lambda = \\sum_l w_l$.\n",
"\n",
"Thus, the walk operator $W$ encodes the spectrum of $H$ as a function of eigenphases of $W$\n",
"s.t. $spectrum(H) = \\lambda cos(arg(spectrum(W)))$ where $arg(e^{i\\phi}) = \\phi$.\n",
Expand Down
2 changes: 1 addition & 1 deletion qualtran/bloqs/qubitization_walk_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class QubitizationWalkOperator(GateWithRegisters):
select: The SELECT lcu gate implementing $SELECT=\sum_{l}|l><l|H_{l}$.
prepare: Then PREPARE lcu gate implementing
$PREPARE|00...00> = \sum_{l=0}^{L - 1}\sqrt{\frac{w_{l}}{\lambda}} |l> = |\ell>$
sum_of_lcu_coefficients: value of $\lambda$, i.e. sum of the coefficients $w_l$.
control_val: If 0/1, a controlled version of the walk operator is constructed. Defaults to
None, in which case the resulting walk operator is not controlled.
power: Constructs $W^{power}$ by repeatedly decomposing into `power` copies of $W$.
Expand Down Expand Up @@ -97,6 +96,7 @@ def reflect(self) -> ReflectionUsingPrepare:

@cached_property
def sum_of_lcu_coefficients(self) -> Optional[float]:
r"""value of $\lambda$, i.e. sum of the coefficients $w_l$."""
return self.prepare.l1_norm_of_coeffs

def decompose_from_registers(
Expand Down

0 comments on commit 1d1612f

Please sign in to comment.