-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
3,597 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/README.md |
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_cost_functions.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_cost_functions.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_gradient_descent_strategies.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_gradient_descent_strategies.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_group_commutator_tests.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_group_commutator_tests.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_scheduling.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_strategies_compare.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_strategies_compare.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_strategy_Ising_model.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_strategy_Ising_model.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_strategy_Pauli-Z.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_strategy_Pauli-Z.ipynb |
1 change: 1 addition & 0 deletions
1
doc/source/code-examples/tutorials/dbi/dbi_tutorial_basic_intro.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../examples/dbi/dbi_tutorial_basic_intro.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Double-bracket quantum algorithms | ||
|
||
Qibo features a model implementing double-bracke quantum algorithms (DBQAs) which are helpful for approximating eigenstates based on the ability to run the evolution under the input Hamiltonian. | ||
|
||
More specifically, given a Hamiltonian $H_0$, how can we find a circuit which after applying to the reference state (usually $|0\rangle^{\otimes L}$ for $L$ qubits) will approximate an eigenstate? | ||
|
||
A standard way is to run variational quantum circuits. For example, Qibo already features the `VQE` model [2] which provides the implementation of the variational quantum eigensolver framework. | ||
DBQAs allow to go beyond VQE in that they take a different approach to compiling the quantum circuit approximating the eigenstate. | ||
|
||
## What is the unitary of DBQA? | ||
|
||
Given $H_0$ we begin by assuming that we were given a diagonal and hermitian operator $D_0$ and a time $s_0$. | ||
The `dbi` module provides numerical strategies for selecting them. | ||
For any such choice we define the bracket | ||
$$ W_0 = [D_0, H_0]$$ | ||
and the double-bracket rotation (DBR) of the input Hamiltonian to time $s$ | ||
$$H_0(s) = e^{sW} H e^{- s W}$$ | ||
|
||
### Why are double-bracket rotations useful? | ||
We can show that the magnitude of the off-diagonal norms will decrease. | ||
For this let us set the notation that $\sigma(A)$ is the restriction to the off-diagonal of the matrix A. | ||
In `numpy` this can be implemented by `\sigma(A) = A-np.diag(A)`. In Qibo we implement this as | ||
https://github.com/qiboteam/qibo/blob/8c9c610f5f2190b243dc9120a518a7612709bdbc/src/qibo/models/dbi/double_bracket.py#L145-L147 | ||
which is part of the basic `DoubleBracketIteration` class in the `dbi` module. | ||
|
||
With this notation we next use the Hilbert-Schmidt scalar product and norm to measure the progress of diagonalization | ||
$$||\sigma(H_0(s))||^2- ||\sigma (H_0 )||^2= -2s \langle W, [H,\sigma(H)\rangle+O(s^2)$$ | ||
This equation tells us that as long as the scalar product $\langle W, [H,\sigma(H)\rangle$ is positive then after the DBR the magnitude of the off-diagonal couplings in $H_0(s)$ is less than in $H_0$. | ||
|
||
For the implementation of the DBR unitary $U_0(s) = e^{-s W_0}$ see | ||
https://github.com/qiboteam/qibo/blob/363a6e5e689e5b907a7602bd1cc8d9811c60ee69/src/qibo/models/dbi/double_bracket.py#L68 | ||
|
||
### How to choose $D$? | ||
|
||
For theoretical considerations the canonical bracket is useful. | ||
For this we need the notation of the dephasing channel $\Delta(H)$ which is equivalent to `np.diag(h)`. | ||
$M = [\Delta(H),\sigma(H)]= [H,\sigma(H)]= [\Delta(H),H]$ | ||
The canonical bracket appears on its own in the monotonicity relation above and gives an unconditional reduction of the magnitude of the off-diagonal terms | ||
$$||\sigma(H_0(s))||^2- ||\sigma (H_0 )||^2= -2s ||M||^2+O(s^2)$$ | ||
- the multi qubit Pauli Z generator with $Z(\mu) = (Z_1)^{\mu_1}\ldots (Z_L)^{\mu_L}$ where we optimize over all binary strings $\mu\in \{0,1\}^L$ | ||
- the magnetic field $D = \sum_i B_i Z_i$ | ||
- the two qubit Ising model $D = \sum_i B_i Z_i + \sum_{i,j} J_{i,j} Z_i Z_j$, please follow the tutorial by Matteo and use the QIBO ising model for that with $h=0$ | ||
|
||
|
||
### How to choose s? | ||
|
||
The theory above shows that in generic cases the DBR will have a linear diagonalization effect (as quantified by $||\sigma(H_0(s))||$). | ||
This can be further expanded with Taylor expansion and the Qibo implementation comes with methods for fitting the first local minimum. | ||
Additionally a grid search for the optimal step is provided for an exhaustive evaluation and hyperopt can be used for a more efficient 'unstructured' optimization; additionally simulated annealing is provided which sometimes outperforms hyperopt (and grid search), see example notebooks. | ||
The latter methods may output DBR durations $s_k$ which correspond to secondary local minima. | ||
|
||
|
||
|
||
|
||
|
||
[1] https://arxiv.org/abs/2206.11772 | ||
|
||
[2] https://github.com/qiboteam/vqe-sun |
Oops, something went wrong.