Skip to content

Commit

Permalink
Noise module (#25)
Browse files Browse the repository at this point in the history
* Init

* Fixed Problems in PresetQiskitNoisyBackend.py

* Clean up in PresetQiskitNoisyBackend.py and CustomQiskitNoisyBackend.py

* Deactivated CircuitCopulaIBM

* Revised IBM Quantum Deployment. I would suggest to revise it in Q3/2024, since IBM will change a lot in the near future.

* MMD Update

* MMD Update - QCBM removed for now

* renamed IBM Backends

* removed plt.ioff statement

* Added ibm_runtime to get_requirements and removed redundant input

* Update requirements_full.txt

* typo

* Adjusted qiskit package versions.

* Avoid lynting errors.

* Avoid lynting error caused by dependencies.

* Hopefully solved the dependency issues for now.

* Addressing dependency issues by temporarily removing ibm-runtime-dependent content.

* Updated moduledb and removed remaining ibm_runtime-dependent parts.

---------

Co-authored-by: Maximilian Wolf <[email protected]>
Co-authored-by: Marvin Erdmann (FG-231) <[email protected]>
  • Loading branch information
2 people authored and atc-github committed May 13, 2024
1 parent de5162f commit e797af9
Show file tree
Hide file tree
Showing 15 changed files with 3,804 additions and 2,419 deletions.
5,192 changes: 2,855 additions & 2,337 deletions .settings/module_db.json

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions .settings/requirements_full.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
seaborn==0.13.0
networkx==2.8.8
inquirer==3.1.2
packaging==23.1
pyyaml==6.0
typing-extensions==4.6.3
sphinx==6.2.1
sphinx-rtd-theme==1.2.0
numpy==1.23.5
dimod==0.12.5
amazon-braket-sdk==1.35.1
scipy==1.11.1
botocore==1.25.7
boto3==1.22.7
pennylane==0.28.0
pennylane-lightning==0.28.0
amazon-braket-pennylane-plugin==1.5.2
dwave-samplers==1.0.0
nnf==0.4.1
qubovert==1.2.5
python-sat==0.1.7.dev26
more-itertools==9.0.0
qiskit-optimization==0.5.0
pyqubo==1.4.0
dwave_networkx==0.8.13
qiskit==0.40.0
pandas==1.5.2
cma==3.3.0
tensorboard==2.13.0
tensorboardX==2.6.2
seaborn==0.13.0
networkx==2.8.8
inquirer==3.1.2
packaging==23.1
pyyaml==6.0
typing-extensions==4.6.3
sphinx==6.2.1
sphinx-rtd-theme==1.2.0
numpy==1.23.5
dimod==0.12.5
amazon-braket-sdk==1.35.1
scipy==1.11.1
botocore==1.25.7
boto3==1.22.7
pennylane==0.28.0
pennylane-lightning==0.28.0
amazon-braket-pennylane-plugin==1.5.2
dwave-samplers==1.0.0
nnf==0.4.1
qubovert==1.2.5
python-sat==0.1.7.dev26
more-itertools==9.0.0
qiskit-optimization==0.5.0
pyqubo==1.4.0
dwave_networkx==0.8.13
qiskit==0.45.0
pandas==1.5.2
qiskit-ibmq-provider==0.19.2
cma==3.3.0
tensorboard==2.13.0
tensorboardX==2.6.2
qiskit_aer==0.11.2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import pickle
import os
from qiskit import qpy

import numpy as np
import pandas as pd
Expand All @@ -25,7 +26,7 @@

class DataHandler(Core, ABC):
"""
The task of the DataHandler module is to translate the application’s data
The task of the DataHandler module is to translate the application’s data
and problem specification into preproccesed format.
"""

Expand Down Expand Up @@ -150,6 +151,10 @@ def postprocess(self, input_data: dict, config: dict, **kwargs):
with open(f"{store_dir_iter}/training_results-{kwargs['rep_count']}.pkl", 'wb') as f:
pickle.dump(input_data, f)

if "circuit_transpiled" in list(input_data.keys()):
with open(f"{store_dir_iter}/transpiled_circuit_{kwargs['rep_count']}.qpy", 'wb') as f:
qpy.dump(input_data.pop("circuit_transpiled"), f)

# Save variables transformed space
if "Transformation" in list(input_data.keys()):
self.metrics.add_metric_batch({"KL_best": input_data["KL_best_transformed"]})
Expand All @@ -164,7 +169,7 @@ def postprocess(self, input_data: dict, config: dict, **kwargs):
@abstractmethod
def data_load(self, gen_mod: dict, config: dict) -> dict:
"""
Helps to ensure that the model can effectively learn the underlying
Helps to ensure that the model can effectively learn the underlying
patterns and structure of the data, and produce high-quality outputs.
:param gen_mod: dictionary with collected information of the previous modules
Expand Down Expand Up @@ -207,12 +212,12 @@ def evaluate(self, solution: any) -> (dict, float):
@staticmethod
def tb_to_pd(logdir: str, rep: str) -> None:
"""
Converts TensorBoard event files in the specified log directory
Converts TensorBoard event files in the specified log directory
into a pandas DataFrame and saves it as a pickle file.
:param logdir: path to the log directory containing TensorBoard event files
:type logdir: str
:type logdir: str
"""
event_acc = EventAccumulator(logdir)
event_acc.Reload()
Expand Down
Loading

0 comments on commit e797af9

Please sign in to comment.