Skip to content

Commit

Permalink
Improvements again
Browse files Browse the repository at this point in the history
  • Loading branch information
madagra committed Oct 10, 2023
1 parent cf49348 commit bde4870
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 172 deletions.
21 changes: 14 additions & 7 deletions docs/tutorials/qml_tools.md → docs/qml/qml_tools.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Quantum Machine Learning Constructors
# Quantum machine learning constructors

Besides the [arbitrary Hamiltonian constructors](hamiltonians.md), Qadence also provides a complete set of program constructors useful for digital-analog quantum machine learning programs.
Besides the [arbitrary Hamiltonian constructors](../tutorials/hamiltonians.md), Qadence also provides a complete set of
program constructors useful for digital-analog quantum machine learning programs.

## Feature Maps
## Feature maps

A few feature maps are directly available for feature loading,
A few feature maps are directly available for loading classical data into quantum circuits by encoding them
into gate rotation angles.

```python exec="on" source="material-block" result="json" session="fms"
from qadence import feature_map
Expand All @@ -21,9 +23,11 @@ fm = feature_map(n_qubits, fm_type="tower")
print(f"Tower {fm}") # markdown-exec: hide
```

## Hardware-Efficient Ansatz
## Hardware-efficient ansatz

Ansatze blocks for quantum machine-learning are typically built following the Hardware-Efficient Ansatz formalism (HEA). Both fully digital and digital-analog HEAs can easily be built with the `hea` function. By default, the digital version is returned:
Ansatze blocks for quantum machine-learning are typically built following the Hardware-Efficient Ansatz formalism (HEA).
Both fully digital and digital-analog HEAs can easily be built with the `hea` function. By default,
the digital version is returned:

```python exec="on" source="material-block" html="1" session="ansatz"
from qadence import hea
Expand Down Expand Up @@ -55,7 +59,7 @@ from qadence.draw import html_string # markdown-exec: hide
print(html_string(ansatz, size="4,4")) # markdown-exec: hide
```

Having a truly *hardware-efficient* ansatz means that the entangling operation can be chosen according to each device's native interactions. Besides digital operations, in Qadence it is also possible to build digital-analog HEAs with the entanglement produced by the natural evolution of a set of interacting qubits, as is natural in neutral atom devices. As with other digital-analog functions, this can be controlled with the `strategy` argument which can be chosen from the [`Strategy`](../qadence/types.md) enum type. Currently, only `Strategy.DIGITAL` and `Strategy.SDAQC` are available. By default, calling `strategy = Strategy.SDAQC` will use a global entangling Hamiltonian with Ising-like NN interactions and constant interaction strength inside a `HamEvo` operation,
Having a truly *hardware-efficient* ansatz means that the entangling operation can be chosen according to each device's native interactions. Besides digital operations, in Qadence it is also possible to build digital-analog HEAs with the entanglement produced by the natural evolution of a set of interacting qubits, as natively implemented in neutral atom devices. As with other digital-analog functions, this can be controlled with the `strategy` argument which can be chosen from the [`Strategy`](../qadence/types.md) enum type. Currently, only `Strategy.DIGITAL` and `Strategy.SDAQC` are available. By default, calling `strategy = Strategy.SDAQC` will use a global entangling Hamiltonian with Ising-like NN interactions and constant interaction strength inside a `HamEvo` operation,

```python exec="on" source="material-block" html="1" session="ansatz"
from qadence import Strategy
Expand Down Expand Up @@ -104,6 +108,9 @@ for optimizing fully-differentiable models like `QNN`s and `QuantumModel`s conta

## Machine Learning Tools

`qadence` also offers a out-of-the-box training routine called `train_with_grad`
for optimizing fully-differentiable models like `QNN`s and `QuantumModel`s containing either *trainable* and/or *non-trainable* parameters (i.e., inputs). Feel free to [refresh your memory about different parameter types](/tutorials/parameters).

`train_with_grad` performs training, logging/printing loss metrics and storing intermediate checkpoints of models.

As every other training routine commonly used in Machine Learning, it requires
Expand Down
154 changes: 0 additions & 154 deletions docs/tutorials/ml_tools.md

This file was deleted.

22 changes: 11 additions & 11 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ nav:
- Wavefunction Overlaps: tutorials/overlap.md
- Serialization: tutorials/serializ_and_prep.md
- Backends: tutorials/backends.md
- Tools for Classical and Quantum Machine Learning: tutorials/qml_tools.md

- Digital-Analog Quantum Computing:
- digital_analog_qc/daqc-basics.md
- Digital-Analog Emulation:
- Basics: digital_analog_qc/analog-basics.md
- Solve a QUBO Problem: digital_analog_qc/analog-qubo.md
- Pulse-level Programming with Pulser: digital_analog_qc/pulser-basic.md
- Pulse-level programming with Pulser: digital_analog_qc/pulser-basic.md
- DAQC Transform:
- CNOT with Interacting Qubits: digital_analog_qc/daqc-cnot.md
- CNOT with interacting qubits: digital_analog_qc/daqc-cnot.md

- Variational Quantum Algorithms:
- qml/index.md
- Quantum Circuit Learning: qml/qcl.md
- QAOA for Solving MaxCut: qml/qaoa.md
- Quantum circuit learning: qml/qcl.md
- Solving MaxCut with QAOA: qml/qaoa.md
- Tools for quantum machine learning: qml/qml_tools.md

- Advanced Tutorials:
- Quantum circuits differentiation: advanced_tutorials/differentiability.md
- Custom QuantumModels: advanced_tutorials/custom-models.md
- Custom quantum models: advanced_tutorials/custom-models.md
- Ground-state VQE: advanced_tutorials/vqe.md

- API:
Expand All @@ -43,24 +43,24 @@ nav:
- Register: qadence/register.md
- QuantumCircuit: qadence/quantumcircuit.md
- Parameters: qadence/parameters.md
- State Preparation: qadence/states.md
- State preparation: qadence/states.md
- Constructors: qadence/constructors.md
- Transpilation: qadence/transpile.md
- Execution: qadence/execution.md
- Quantum Models: models.md
- Machine Learning Tools: qadence/ml_tools.md
- Quantum models: models.md
- QML tools: qadence/ml_tools.md
- Serialization: qadence/serialization.md
- Types: qadence/types.md

- Backends:
- Abstract Backend: backends/backend.md
- Abstract backend: backends/backend.md
- PyQTorch: backends/pyqtorch.md
- Amazon Braket: backends/braket.md
- Pulser: backends/pulser.md
- DifferentiableBackend: backends/differentiable.md

- Development:
- Architecture and Sharp Bits: development/architecture.md
- Architecture and sharp bits: development/architecture.md
- Drawing: development/draw.md
- Contributing: development/contributing.md

Expand Down

0 comments on commit bde4870

Please sign in to comment.