Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix document site design #39

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ venv.bak/
.ropeproject

# mkdocs documentation
# /site
/site

# mypy
.mypy_cache/
Expand Down
18 changes: 13 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Qamomile
## What is Qamomile
Qamomile is Quantum Algorithm for Mathematical OptiMization with jIjmodeLing Extension.
Qamomile is a library that supports running quantum optimization algorithms with various quantum computation libraries.
Currently, Qamomile supports two quantum computation libraries, [Qiskit](https://www.ibm.com/quantum/qiskit) and [QURI-Part](https://quri-parts.qunasys.com/).

You can easily create Ising Hamiltonians and encoded Hamiltonians from mathematical models using Qamomile.
Qamomile stands for Quantum Algorithm for Mathematical OptiMization with jIjmodeLing Extension. It transforms mathematical models written by [JijModeling](https://www.documentation.jijzept.com/docs/jijmodeling) into Ising Hamiltonians and various other encoded Hamiltonians such as Quantum Random Access Optimization.

## Installation

The installation for qiskit is
```bash
# jijmodeling-transpiler-quantum for qiskit
pip install "jijmodeling-transpiler-quantum[qiskit]"
```

The installation for QURI Parts is
```bash
# jijmodeling-transpiler-quantum for quri-parts
pip install "jijmodeling-transpiler-quantum[quri-parts]"
```

## Quickstart
In the following example, QAOA for the graph colouring problem is implemented using Qamomile.
```python
Expand Down Expand Up @@ -66,5 +74,5 @@ sampleset = qaoa_builder.decode_from_quasi_dist(result.eigenstate)
sampleset.feasible()
```

# Dicord
Join our discord channel!
## Community
Join our [discord channel](https://discord.gg/Km5dKF9JjG)!
6 changes: 3 additions & 3 deletions docs/tutorial/alternating_ansatz_graph_coloring_qiskit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@
"# Quantum Approximate Optimazation Algorithm (QAOA)\n",
"The Quantum Approximate Optimization Algorithm (QAOA) is one of the quantum optimization algorithms that use a variational quantum circuit. For a detailed explanation, please refer to paper [1], but here we will only give a rough overview.\n",
"In QAOA, a variational quantum circuit is constructed by applying the Ising Hamiltonian $H_P = \\sum_{ij}J_{ij}Z_iZ_j$ and the $X$-mixer Hamiltonian $H_M = \\sum_iX_i$ in the following way:\n",
"If we start with an initial state $\\ket{\\psi_0}$, then\n",
"$$\\ket{\\psi(\\beta,\\gamma)} = e^{-\\beta_pH_M}e^{-\\gamma_pH_P}\\cdots e^{-\\beta_1H_M}e^{-\\gamma_1H_P}\\ket{\\psi_0}$$\n",
"If we start with an initial state $|\\psi_0\\rangle$, then\n",
"$$|\\psi(\\beta,\\gamma)\\rangle = e^{-\\beta_pH_M}e^{-\\gamma_pH_P}\\cdots e^{-\\beta_1H_M}e^{-\\gamma_1H_P}|\\psi_0\\rangle$$\n",
"can be written. Here, $\\beta_k,\\gamma_k$ are the parameters to be optimized, and since the operation $e^{-\\beta_kH_M}e^{-\\gamma_kH_P}$ is repeated $p$ times, there are a total of $2p$ parameters. In the standard QAOA, the total number of parameters is independent of the number of qubits and depends only on the number of repetitions.\n",
"\n",
"Optimization of $\\beta_k,\\gamma_k$ is performed by repeating the following steps 1 and 2:\n",
"\n",
"1. Compute the expectation value $\\bra{\\psi(\\beta,\\gamma)}H_P\\ket{\\psi(\\beta,\\gamma)}$ on a quantum device.\n",
"1. Compute the expectation value $\\langle\\psi(\\beta,\\gamma)|H_P|\\psi(\\beta,\\gamma)\\rangle$ on a quantum device.\n",
"2. Update the parameters on a classical computer to minimize the expectation value.\n",
"\n",
"By repeating this calculation of the expectation value on the quantum computer and optimization of parameters on the classical computer, we obtain the minimum energy $\\langle H_P \\rangle$ and the corresponding final state. If we consider QAOA as a mathematical optimization algorithm, this minimum energy corresponds to the minimum objective function value, and the final state becomes the optimal solution."
Expand Down
17 changes: 10 additions & 7 deletions docs/tutorial/alternating_ansatz_graph_coloring_quri.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@
"# Quantum Approximate Optimazation Algorithm (QAOA)\n",
"The Quantum Approximate Optimization Algorithm (QAOA) is one of the quantum optimization algorithms that use a variational quantum circuit. For a detailed explanation, please refer to paper [1], but here we will only give a rough overview.\n",
"In QAOA, a variational quantum circuit is constructed by applying the Ising Hamiltonian $H_P = \\sum_{ij}J_{ij}Z_iZ_j$ and the $X$-mixer Hamiltonian $H_M = \\sum_iX_i$ in the following way:\n",
"If we start with an initial state $\\ket{\\psi_0}$, then\n",
"$$\\ket{\\psi(\\beta,\\gamma)} = e^{-\\beta_pH_M}e^{-\\gamma_pH_P}\\cdots e^{-\\beta_1H_M}e^{-\\gamma_1H_P}\\ket{\\psi_0}$$\n",
"If we start with an initial state $|\\psi_0\\rangle$, then\n",
"$$|\\psi(\\beta,\\gamma)\\rangle = e^{-\\beta_pH_M}e^{-\\gamma_pH_P}\\cdots e^{-\\beta_1H_M}e^{-\\gamma_1H_P}|\\psi_0\\rangle$$\n",
"can be written. Here, $\\beta_k,\\gamma_k$ are the parameters to be optimized, and since the operation $e^{-\\beta_kH_M}e^{-\\gamma_kH_P}$ is repeated $p$ times, there are a total of $2p$ parameters. In the standard QAOA, the total number of parameters is independent of the number of qubits and depends only on the number of repetitions.\n",
"\n",
"Optimization of $\\beta_k,\\gamma_k$ is performed by repeating the following steps 1 and 2:\n",
"\n",
"1. Compute the expectation value $\\bra{\\psi(\\beta,\\gamma)}H_P\\ket{\\psi(\\beta,\\gamma)}$ on a quantum device.\n",
"1. Compute the expectation value $\\langle\\psi(\\beta,\\gamma)|H_P|\\psi(\\beta,\\gamma)\\rangle$ on a quantum device.\n",
"2. Update the parameters on a classical computer to minimize the expectation value.\n",
"\n",
"By repeating this calculation of the expectation value on the quantum computer and optimization of parameters on the classical computer, we obtain the minimum energy $\\langle H_P \\rangle$ and the corresponding final state. If we consider QAOA as a mathematical optimization algorithm, this minimum energy corresponds to the minimum objective function value, and the final state becomes the optimal solution."
Expand Down Expand Up @@ -769,11 +769,14 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": []
"source": [
"## References\n",
"[1] E. Farhi et al., \"A Quantum Approximate Optimization Algorithm\" arXiv (2014)\n",
"\n",
"[2] S. Hadfield et al., \"From the Quantum Approximate Optimization Algorithm to a Quantum Alternating Operator Ansatz\", algorithms (2019)"
]
}
],
"metadata": {
Expand Down
14 changes: 13 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ copyright: Copyright © 2023-2024 Jij Inc.
# Configuration
theme:
name: material
features:
- content.code.annotate
- content.code.copy

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences

nav:
- Home: index.md
Expand All @@ -38,4 +50,4 @@ plugins:
scripts:
- docs/overrides/gen_ref_pages.py
- mkdocs-jupyter:
ignore_h1_titles: True

Loading
Loading