Skip to content

Commit

Permalink
[Documentation] Adding a small note gpsr hamevo (#263)
Browse files Browse the repository at this point in the history
And bump version
  • Loading branch information
chMoussa authored Aug 14, 2024
1 parent c6bbce3 commit 2c2eacf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/differentiation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ F_{S} & =4\overset{S}{\underset{s=1}{\sum}}{\rm sin}\left(\frac{\delta_{M}\Delta

Here $F_s=f(x+\delta_s)-f(x-\delta_s)$ denotes the difference between values of functions evaluated at shifted arguments $x\pm\delta_s$.

!!! caution "Using GPSR with HamiltonianEvolution"
GPSR works with the formalism above-presented, which corresponds to many parametric operations such as rotation gates.
For HamiltonianEvolution, since the factor 1/2 is missing, to allow GPSR differentiation, we multiply by 2 the
spectral gaps. Also we use a shift prefactor of 0.5 for multi-gap GPSR or 0.5 divided by the spectral gap for single-gap GPSR.


### Example
```python exec="on" source="material-block" html="1"
import pyqtorch as pyq
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "pyqtorch"
description = "An efficient, large-scale emulator designed for quantum machine learning, seamlessly integrated with a PyTorch backend. Please refer to https://pyqtorch.readthedocs.io/en/latest/ for setup and usage info, along with the full documentation."
readme = "README.md"
version = "1.4.1"
version = "1.4.2"
requires-python = ">=3.8,<3.13"
license = { text = "Apache 2.0" }
keywords = ["quantum"]
Expand Down

0 comments on commit 2c2eacf

Please sign in to comment.