Skip to content

Commit d236f38

Browse files
committedFeb 2, 2023
port aws jobs to the refactored branch
1 parent 92c11b8 commit d236f38

File tree

11 files changed

+33
-21
lines changed

11 files changed

+33
-21
lines changed
 

‎.github/workflows/test_dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: |
6262
source env/bin/activate
6363
ipython kernel install --name "env" --user
64-
python -m pytest -v -m 'not (qpu or api)' --cov --cov-report=xml:coverage.xml
64+
python -m pytest -v -m 'not (qpu or api or docker_aws)' --cov --cov-report=xml:coverage.xml
6565
6666
- name: Upload coverage reports to Codecov with GitHub Action
6767
uses: codecov/codecov-action@v3

‎.github/workflows/test_main_linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
source env/bin/activate
6262
ipython kernel install --name "env" --user
63-
python -m pytest -v -m 'not (qpu or api)'
63+
python -m pytest -v -m 'not (qpu or api or docker_aws)'
6464
6565
- name: Upload coverage reports to Codecov with GitHub Action
6666
uses: codecov/codecov-action@v3

‎.github/workflows/test_main_macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
run: |
5656
source env/bin/activate
5757
ipython kernel install --user --name "env"
58-
python -m pytest -v -m 'not (qpu or api)'
58+
python -m pytest -v -m 'not (qpu or api or docker_aws)'

‎.github/workflows/test_main_windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
run: |
6969
.\env\Scripts\Activate.ps1
7070
ipython kernel install --name "env" --user
71-
python -m pytest -v -m 'not (qpu or api)'
71+
python -m pytest -v -m 'not (qpu or api or docker_aws)'

‎.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,10 @@ dmypy.json
132132
/.idea/
133133

134134
# Mac Stuff
135-
*.DS_Store
135+
*.DS_Store
136+
137+
# Braket files
138+
braket-job*/
139+
140+
# Visual Studio code
141+
.vscode/

‎docs/source/qaoaparameters.rst

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Parameters
4141
:members:
4242
:undoc-members:
4343
:inherited-members:
44+
:noindex:
4445

4546

4647
Standard Parameters

‎pytest.ini

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[pytest]
22
markers =
3-
qpu: marks tests that requirea QPU connection (deselect with '-m "not qpu"')
4-
api: marks tests that requirea coonection to a QC cloud (deselect with '-m "not api"')
5-
qvm: marks tests that requirea attive Rigetti QVM and QILC compiler (deselect with '-m "not qvm"')
3+
qpu: marks tests that require a QPU connection (deselect with '-m "not qpu"')
4+
api: marks tests that require a coonection to a QC cloud (deselect with '-m "not api"')
5+
qvm: marks tests that require an attive Rigetti QVM and QILC compiler (deselect with '-m "not qvm"')
6+
docker_aws: marks tests that require to build aws docker (deselect with '-m "not docker_aws"')
7+
notebook: marks tests that run on jupyter noteboks (deselect with '-m "not notebook"')
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from .qaoa import QAOA, QAOAResult
2-
from .rqaoa import RQAOA, RQAOAResults
2+
from .rqaoa import RQAOA, RQAOAResults
3+
from .jobs.managed_job import AWSJobs

‎src/openqaoa-core/algorithms/baseworkflow.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,10 @@ def _serializable_dict(
365365
data["input_parameters"]["backend_properties"][item]
366366
)
367367

368-
data["results"] = self.results.asdict(
369-
False, complex_to_string, intermediate_mesurements
370-
)
368+
if not self.results is None:
369+
data["results"] = self.results.asdict(
370+
False, complex_to_string, intermediate_mesurements
371+
)
371372

372373
# create the final header dictionary
373374
header = self.header.copy()

‎src/openqaoa-core/qaoa_components/ansatz_constructor/baseparams.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from .operators import Hamiltonian
77
from .hamiltonianmapper import HamiltonianMapper
8+
from .gatemap import RotationGateMap
89

910

1011
def _is_iterable_empty(in_iterable):
@@ -112,7 +113,7 @@ class QAOADescriptor(AnsatzDescriptor):
112113
cost_hamiltonian: `Hamiltonian`
113114
The cost hamiltonian of the problem the user is trying to solve.
114115
115-
mixer_block: `Union[List[RotationGateMap], Hamiltonian]`
116+
mixer_block: Union[List[RotationGateMap], Hamiltonian]
116117
The mixer hamiltonian or a list of initialised RotationGateMap objects
117118
that defines the gates to be used within the "mixer part" of the circuit.
118119

‎src/openqaoa-core/utilities.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1625,13 +1625,13 @@ def check_kwarg(expected_param, default_value, **kwargs):
16251625

16261626
def dicke_basis(excitations: int, n_qubits: int) -> np.ndarray:
16271627
"""
1628-
Generates the Dicke basis state |ek> with k excitations
1628+
Generates the Dicke basis state $|ek>$ with $k$ excitations
16291629
16301630
Parameters
16311631
----------
1632-
excitations:
1632+
excitations: int
16331633
Number of excitations in the basis vector
1634-
n_qubits:
1634+
n_qubits: int
16351635
Total number of qubits in the system
16361636
16371637
Returns
@@ -1683,20 +1683,20 @@ def dicke_wavefunction(excitations, n_qubits):
16831683

16841684
def k_cumulative_excitations(k: int, n_qubits: int):
16851685
"""
1686-
Generates the Upper bound excitations basis vector |Ek>, which a superposition of all
1687-
Dicke basis vectors upto excitation number "k"
1686+
Generates the Upper bound excitations basis vector $|Ek>$, which a superposition of all
1687+
Dicke basis vectors upto excitation number $k$
16881688
16891689
Parameters
16901690
----------
1691-
k:
1691+
k: int
16921692
Upper bound on number of excitations in the basis vector
1693-
n_qubits:
1693+
n_qubits: int
16941694
Total number of qubits in the system
16951695
16961696
Returns
16971697
-------
16981698
wavefunction:
1699-
The wavefunction vector for a given cumulative Dicke states with <=k excitations
1699+
The wavefunction vector for a given cumulative Dicke states with $<=k$ excitations
17001700
17011701
"""
17021702
cumulative_dicke_bases = np.array(["0" * n_qubits])

0 commit comments

Comments
 (0)
Please sign in to comment.