Skip to content

Commit

Permalink
fix typos and update license
Browse files Browse the repository at this point in the history
  • Loading branch information
Q-lds committed Feb 20, 2023
1 parent 6b5265e commit 79dfa6e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 41 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![Documentation Status](https://readthedocs.org/projects/el-openqaoa/badge/?version=latest)](https://el-openqaoa.readthedocs.io/en/latest/?badge=latest) <!-- Readthedocs -->
[![PyPI version](https://badge.fury.io/py/openqaoa.svg)](https://badge.fury.io/py/openqaoa) <!-- PyPI -->
[![arXiv](https://img.shields.io/badge/arXiv-2210.08695-<COLOR>.svg)](https://arxiv.org/abs/2210.08695) <!-- arXiv -->
[![License](https://img.shields.io/badge/%F0%9F%AA%AA%20license-Apache%20License%202.0-lightgrey)](LICENSE.md)<!-- License -->
[![License](https://img.shields.io/pypi/l/openqaoa)](LICENSE.md)<!-- License -->
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)<!-- Covenant Code of conduct -->
[![Downloads](https://pepy.tech/badge/openqaoa)](https://pepy.tech/project/openqaoa)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entropicalabs/openqaoa.git/main?labpath=%2Fexamples)
Expand All @@ -23,6 +23,8 @@ A multi-backend python library for quantum optimization using QAOA on Quantum co

Please, consider [joining our discord](https://discord.gg/ana76wkKBd) if you want to be part of our community and participate in the OpenQAOA's development.

Check out OpenQAOA website [https://openqaoa.entropicalabs.com/](https://openqaoa.entropicalabs.com/)

## Installation instructions

You can install the latest version of OpenQAOA directly from PyPi. First, create a virtual environment with python3.8+ and then simply pip install openqaoa with the following command
Expand Down
14 changes: 0 additions & 14 deletions src/openqaoa-core/algorithms/jobs/managed_job.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Copyright 2022 Entropica Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from openqaoa_braket.backends import DeviceAWS
Expand Down
10 changes: 5 additions & 5 deletions src/openqaoa-core/algorithms/rqaoa/rqaoa_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@ def from_dict(
dictionary:dict
):
"""
Creates a RQAOAResul object from a dictionary (which is the output of the asdict method).
Creates a RQAOAResult object from a dictionary (which is the output of the asdict method).
Parameters
----------
dictionary : dict
The input dictionary.
Returns
-------
RQAOAResul
The RQAOAResul object.
RQAOAResult
The RQAOAResult object.
"""

# deepcopy the dictionary, so that the original dictionary is not changed
dictionary = copy.deepcopy(dictionary)

# create a new RQAOAResul object
# create a new RQAOAResult object
results = cls()

# add the keys of the dictionary to the RQAOAResul object
# add the keys of the dictionary to the RQAOAResult object
for key, value in dictionary.items():
results[key] = value

Expand Down
8 changes: 4 additions & 4 deletions src/openqaoa-core/algorithms/rqaoa/rqaoa_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ class RQAOA(Workflow):
For a complete list of its parameters and usage please see the method set_circuit_properties
rqaoa_parameters: `RqaoaParameters`
Set of parameters containing all the relevant information for the recursive procedure of RQAOA.
results: `RQAOAResul`
results: `RQAOAResult`
The results of the RQAOA optimization.
Dictionary containing all the information about the RQAOA run: the
solution states and energies (key: 'solution'), the output of the classical
solver (key: 'classical_output'), the elimination rules for each step
(key: 'elimination_rules'), the number of eliminations at each step (key: 'schedule'),
total number of steps (key: 'number_steps'), the intermediate QUBO problems and the
intermediate QAOA objects that have been optimized in each RQAOA step (key: 'intermediate_problems').
This object (`RQAOAResul`) is a dictionary with some custom methods as
RQAOAResul.get_hamiltonian_step(i) which get the hamiltonian of reduced problem of the i-th step.
To see the full list of methods please see the RQAOAResul class.
This object (`RQAOAResult`) is a dictionary with some custom methods as
RQAOAResult.get_hamiltonian_step(i) which get the hamiltonian of reduced problem of the i-th step.
To see the full list of methods please see the RQAOAResult class.
Examples
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .hamiltonianmapper import HamiltonianMapper
from .gatemap import RotationGateMap

from .gatemap import RotationGateMap

def _is_iterable_empty(in_iterable):
if isinstance(in_iterable, Iterable): # Is Iterable
Expand Down
2 changes: 1 addition & 1 deletion src/openqaoa-core/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ def dicke_wavefunction(excitations, n_qubits):
Returns
-------
`np.ndarray`
The wavefunction vector for a given cumulative Dicke states with <=k excitations
The wavefunction vector for a given cumulative Dicke states with $<=k$ excitations
"""

k_dicke = dicke_basis(excitations, n_qubits)
Expand Down
30 changes: 15 additions & 15 deletions tests/jobs_test_input/input_data/openqaoa_params.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"header": {
"atomic_id": "077777dc-dedb-4d43-8fdd-022a9c1b44fc",
"experiment_id": "d831008a-6f69-4c3d-ada5-015a92105825",
"atomic_id": "354d0fc2-6c88-46e7-968b-afd1a85ab4fc",
"experiment_id": "1eb533d2-1a82-4cc6-bd36-ab452b46cb48",
"project_id": null,
"algorithm": "rqaoa",
"name": null,
"description": null,
"run_by": null,
"provider": null,
"target": null,
"cloud": null,
"client": null,
"qubit_number": 10,
"qubit_routing": null,
"error_mitigation": null,
"error_correction": null,
"execution_time_start": null,
"execution_time_end": null,
"metadata": {
Expand All @@ -25,7 +22,7 @@
"p": 1,
"rqaoa_type": "custom",
"rqaoa_n_max": 1,
"rqaoa_n_cutoff": 6
"rqaoa_n_cutoff": 3
}
},
"data": {
Expand Down Expand Up @@ -215,8 +212,8 @@
},
"input_parameters": {
"device": {
"device_location": "aws",
"device_name": "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
"device_location": "local",
"device_name": "vectorized"
},
"backend_properties": {
"init_hadamard": true,
Expand Down Expand Up @@ -271,16 +268,19 @@
"rqaoa_type": "custom",
"n_max": 1,
"steps": [
1,
1,
1,
1
2,
2,
2,
2,
2,
2,
2
],
"n_cutoff": 6,
"n_cutoff": 3,
"original_hamiltonian": null,
"counter": 0
}
},
"results": null
"result": null
}
}

0 comments on commit 79dfa6e

Please sign in to comment.