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

Integrate Fermionic QAOA(FQAOA) Module and Associated Files into OpenQAOA #322

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f03eaf0
Add __init__.py files
yoshioka1128 Aug 19, 2024
43dbef9
Add fqaoa_workflow.py
yoshioka1128 Aug 23, 2024
6f046f4
Add fqaoa_utils.py
yoshioka1128 Aug 23, 2024
c62d3dc
Add test_fqaoa.py and ensure all tests pass
yoshioka1128 Aug 23, 2024
46af746
Add test_analytical_simulator.py and ensure all tests pass
yoshioka1128 Aug 23, 2024
8eebd64
Add test_workflows.py and ensure all tests pass
yoshioka1128 Aug 23, 2024
fe9eee4
new file: 16_FQAOA_examples.ipynb
yoshioka1128 Aug 23, 2024
ce64508
Add missing imports
yoshioka1128 Aug 23, 2024
31da142
Update documentation for FQAOA
yoshioka1128 Aug 26, 2024
ed49ccb
new file: 17_demonstration_of_quantum_annealing_with_FQAOA.ipynb
yoshioka1128 Aug 27, 2024
d3f08b1
Rename file: 17_demonstration_of_quantum_annealing_with_FQAOA.ipynb
yoshioka1128 Aug 28, 2024
6d2b9b5
Fix typos and minor issues based on review comments
yoshioka1128 Sep 4, 2024
2776652
Fix typos
yoshioka1128 Sep 4, 2024
a7e7c86
Enable prepend_state and update tests
yoshioka1128 Sep 4, 2024
5207488
Reduce complexity and reorganize notebook for better structure
yoshioka1128 Sep 5, 2024
9c607cc
Refine docstrings for improved clarity and accuracy
yoshioka1128 Sep 6, 2024
9a66642
Update notebook for consistency with website presentation
yoshioka1128 Sep 9, 2024
931ad4b
Unified numpy.ndarray references to np.ndarray in docstrings and corr…
yoshioka1128 Sep 24, 2024
2ad8d6b
refactor: remove redundant statevector variable and simplify code. pr…
yoshioka1128 Sep 24, 2024
db9001b
Switched from NumPy to SciPy for determinant calc
yoshioka1128 Sep 25, 2024
5428423
Renumber notebooks and made minor corrections to notebooks.
yoshioka1128 Sep 25, 2024
c19528b
feat: Add type hints and consistency check for statevector sizes
yoshioka1128 Sep 25, 2024
33e7290
deleted: source/notebooks
yoshioka1128 Sep 26, 2024
ac9ac27
Modify objective function to include risk factor
yoshioka1128 Oct 7, 2024
2603d99
Update tests to account for risk factor in objective function
yoshioka1128 Oct 8, 2024
3d6f495
Adjust Jupyter notebook to reflect changes in risk factor implementation
yoshioka1128 Oct 8, 2024
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
14 changes: 14 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ Your first RQAOA workflow

rqaoa_type can take two values which select elimination strategies. The user can choose between `adaptive` or `custom`.

Your first FQAOA workflow
-------------------------

.. code-block:: python

from openqaoa import FQAOA
fqaoa = FQAOA()
fqaoa.compile(qubo_problem, n_fermions)
fqaoa.optimize()

FQAOA intrinsically imposes a hard constraint where the hamming weight is equal to n_fermions.

Factory mode
------------
The user is also free to directly access the source code without using the workflow API.
Expand Down Expand Up @@ -305,6 +317,8 @@ Contents
notebooks/14_qaoa_benchmark.ipynb
notebooks/X_dumping_data.ipynb
notebooks/15_Zero_Noise_Extrapolation.ipynb
notebooks/16_FQAOA_example.ipynb
notebooks/17_FQAOA_advanced_parametrization.ipynb

Indices and tables
==================
Expand Down
10 changes: 10 additions & 0 deletions docs/source/openqaoa_core/fqaoa.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Fermionic QAOA functions
========================

A set of utility functions for FQAOA

.. automodule:: openqaoa.algorithms.fqaoa.fqaoa_utils
:members:
:undoc-members:
:inherited-members:

3 changes: 2 additions & 1 deletion docs/source/openqaoa_core/openqaoa_core_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ OpenQAOA Core API Reference

workflows
rqaoa
fqaoa
problems
qaoaparameters
backends
logger_and_results
optimizers
utilities
utilities
8 changes: 6 additions & 2 deletions docs/source/openqaoa_core/workflows.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Workflows
=================================

Workflows are a simple reference API to build complex quantum optimisations problems. Currently, it supports creations of `QAOA` and `Recursive QAOA` workflows.
Workflows are a simple reference API to build complex quantum optimisations problems. Currently, it supports creations of `QAOA`, `Recursive QAOA`, `Fermionic QAOA` workflows.

Workflows are designed to aid the user to focus on the optimisation problem, while delegating the construction and the execution of the specific algorithm to `OpenQAOA`

Expand Down Expand Up @@ -54,7 +54,11 @@ To choose the strategy, set the parameter ``rqaoa_type`` using the `set_rqaoa_pa
:members:
:undoc-members:
:inherited-members:


.. autoclass:: openqaoa.algorithms.fqaoa.fqaoa_workflow.FQAOA
:members:
:undoc-members:
:inherited-members:

RQAOA Workflow Properties
-------------------------
Expand Down
453 changes: 453 additions & 0 deletions examples/16_FQAOA_example.ipynb

Large diffs are not rendered by default.

321 changes: 321 additions & 0 deletions examples/17_FQAOA_advanced_parameterization.ipynb
KilianPoirier marked this conversation as resolved.
Show resolved Hide resolved
yoshioka1128 marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/openqaoa-core/openqaoa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .algorithms import QAOA, RQAOA, QAOABenchmark
from .algorithms import QAOA, RQAOA, FQAOA, QAOABenchmark
from .problems import QUBO
from .backends import create_device
1 change: 1 addition & 0 deletions src/openqaoa-core/openqaoa/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .qaoa import QAOA, QAOAResult, QAOABenchmark
from .rqaoa import RQAOA, RQAOAResult
from .fqaoa import FQAOA
2 changes: 2 additions & 0 deletions src/openqaoa-core/openqaoa/algorithms/fqaoa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .fqaoa_workflow import FQAOA, FermiCircuitProperties, GivensRotationGateMap
from .fqaoa_utils import *
Loading
Loading