diff --git a/.gitignore b/.gitignore index 3c50cff..6769e21 100644 --- a/.gitignore +++ b/.gitignore @@ -136,7 +136,7 @@ venv.bak/ .ropeproject # mkdocs documentation -# /site +/site # mypy .mypy_cache/ diff --git a/docs/index.md b/docs/index.md index ac510ec..c9aaab8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 @@ -66,5 +74,5 @@ sampleset = qaoa_builder.decode_from_quasi_dist(result.eigenstate) sampleset.feasible() ``` -# Dicord -Join our discord channel! \ No newline at end of file +## Community +Join our [discord channel](https://discord.gg/Km5dKF9JjG)! \ No newline at end of file diff --git a/docs/tutorial/alternating_ansatz_graph_coloring_qiskit.ipynb b/docs/tutorial/alternating_ansatz_graph_coloring_qiskit.ipynb index 4397499..c74cac9 100644 --- a/docs/tutorial/alternating_ansatz_graph_coloring_qiskit.ipynb +++ b/docs/tutorial/alternating_ansatz_graph_coloring_qiskit.ipynb @@ -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." diff --git a/docs/tutorial/alternating_ansatz_graph_coloring_quri.ipynb b/docs/tutorial/alternating_ansatz_graph_coloring_quri.ipynb index 698d3bd..bd9e271 100644 --- a/docs/tutorial/alternating_ansatz_graph_coloring_quri.ipynb +++ b/docs/tutorial/alternating_ansatz_graph_coloring_quri.ipynb @@ -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." @@ -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": { diff --git a/mkdocs.yml b/mkdocs.yml index 17d901b..b83599f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 @@ -38,4 +50,4 @@ plugins: scripts: - docs/overrides/gen_ref_pages.py - mkdocs-jupyter: - ignore_h1_titles: True \ No newline at end of file + \ No newline at end of file diff --git a/site/404.html b/site/404.html deleted file mode 100644 index fcba66f..0000000 --- a/site/404.html +++ /dev/null @@ -1,1258 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - -