Skip to content

Commit

Permalink
Module rename
Browse files Browse the repository at this point in the history
  • Loading branch information
IceKhan13 committed Sep 13, 2024
1 parent 3495722 commit d7e4411
Show file tree
Hide file tree
Showing 50 changed files with 118 additions and 124 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

**We appreciate all kinds of help, so thank you!**

## Contributing to Blackwater
## Contributing to ML-QEM

Specific details for contributing to this project are outlined below.

### Reporting Bugs and Requesting Features

Users are encouraged to use GitHub Issues for reporting issues and requesting features.

### Ask/Answer Questions and Discuss Blackwater
### Ask/Answer Questions and Discuss ML-QEM

Users are encouraged to use GitHub Discussions for engaging with researchers, developers, and other users regarding this project and the provided examples.

Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Blackwater

![logo](./docs/images/logo.gif)

Package for solving quantum computing problems using machine learning.
# ML-QEM

Package for quantum error mitigation and solving general quantum computing problems using machine learning.

### Table of Contents

Expand All @@ -21,7 +18,7 @@ Package for solving quantum computing problems using machine learning.
### How to Give Feedback

We encourage your feedback! You can share your thoughts with us by:
- [Opening an issue](https://github.com/IceKhan13/blackwater/issues) in the repository
- [Opening an issue](https://github.com/qiskit-community/ml-qem/issues) in the repository


----------------------------------------------------------------------------------------------------
Expand All @@ -38,7 +35,6 @@ For information on how to contribute to this project, please take a look at our
[2] Qiskit-terra https://github.com/Qiskit/qiskit-terra \
[3] PyTorch https://pytorch.org/ \
[4] PyTorch geometric https://pytorch-geometric.readthedocs.io/en/latest/ \
[5] [Zlatko Minev](https://github.com/zlatko-minev) for :water_polo: :ocean:

----------------------------------------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions blackwater/exception.py

This file was deleted.

17 changes: 0 additions & 17 deletions blackwater/metrics/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions docs/apidocs/data.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _blackwater-data:
.. _ml_qem-data:

.. automodule:: blackwater.data
.. automodule:: ml_qem.data
:no-members:
:no-inherited-members:
:no-special-members:
8 changes: 4 additions & 4 deletions docs/apidocs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. module:: blackwater
.. module:: ml_qem

=========================
BlackWater API References
=========================
=====================
ML-QEM API References
=====================

.. toctree::
:maxdepth: 1
Expand Down
4 changes: 2 additions & 2 deletions docs/apidocs/library.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _blackwater-library:
.. _ml_qem-library:

.. automodule:: blackwater.library
.. automodule:: ml_qem.library
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/metrics.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _blackwater-metrics:
.. _ml_qem-metrics:

.. automodule:: blackwater.metrics
.. automodule:: ml_qem.metrics
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/primitives.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _blackwater-primitives:
.. _ml_qem-primitives:

.. automodule:: blackwater.primitives
.. automodule:: ml_qem.primitives
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/rl.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _blackwater-rl:
.. _ml_qem-rl:

.. automodule:: blackwater.rl
.. automodule:: ml_qem.rl
:no-members:
:no-inherited-members:
:no-special-members:
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

sys.path.append(os.path.abspath('..'))

project = "BlackWater"
project = "ML-QEM"
copyright = "2023" # pylint: disable=redefined-builtin
author = ""

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/01_encoders.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"from qiskit import QuantumCircuit, transpile\n",
"from qiskit.providers.fake_provider import FakeLimaV2\n",
"\n",
"from blackwater.data.encoders.graph_utils import (\n",
"from ml_qem.data.encoders.graph_utils import (\n",
" circuit_to_json_graph, \n",
" backend_to_json_graph, \n",
" BackendNodeEncoder\n",
Expand Down Expand Up @@ -146,7 +146,7 @@
"from qiskit.quantum_info import SparsePauliOp\n",
"from torch_geometric.data import Data\n",
"\n",
"from blackwater.data.encoders.graph_utils import ExpValData"
"from ml_qem.data.encoders.graph_utils import ExpValData"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/03_data_io.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"from qiskit.providers.fake_provider import FakeLimaV2\n",
"from qiskit.quantum_info import SparsePauliOp\n",
"\n",
"from blackwater.data.encoders.graph_utils import ExpValData\n",
"from blackwater.data.dataio.dataio import ExpValDataWriter\n",
"from blackwater.data.loaders.dataclasses import ExpValDataSet"
"from ml_qem.data.encoders.graph_utils import ExpValData\n",
"from ml_qem.data.dataio.dataio import ExpValDataWriter\n",
"from ml_qem.data.loaders.dataclasses import ExpValDataSet"
]
},
{
Expand Down
14 changes: 6 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
##########
BlackWater
##########
######
ML-QEM
######

BlackWater: Library for solving quantum computing problems using machine learning
ML-QEM: Library for quantum error mitigation and solving quantum computing problems using machine learning

.. image:: /images/logo.gif

The source code to the project is available `on GitHub <https://github.com/IceKhan13/blackwater>`_.
The source code to the project is available `on GitHub <https://github.com/qiskit-community/ml-qem>`_.

------------

Expand All @@ -15,7 +13,7 @@ The source code to the project is available `on GitHub <https://github.com/IceKh
.. code-block::
:caption: pip install
pip install blackwater
pip install ml_qem
------------
Expand Down
4 changes: 2 additions & 2 deletions docs/installation_guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Blackwater Installation Guide
# ML-QEM Installation Guide

## PyPi

Expand All @@ -13,7 +13,7 @@ Installation through PyPi is not available
pip install -r requirements.txt
```

3. Installing Blackwater
3. Installing ML-QEM

```shell
pip install .
Expand Down
6 changes: 3 additions & 3 deletions docs/paper/paper.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'BlackWater: library.rst for solving quantum computing problems using machine learning'
title: 'ML-QEM: library.rst for solving quantum computing problems using machine learning'
tags:
- quantum computing
- qiskit
Expand All @@ -19,10 +19,10 @@ bibliography: paper.bib

# Summary

BlackWater is an open-source machine learning library designed to address
ML-QEM is an open-source machine learning library designed to address
the challenges of solving quantum computing problems. By integrating
cutting-edge machine learning techniques with the intricacies of quantum
computing, BlackWater provides a comprehensive set of tools for researchers
computing, ML-QEM provides a comprehensive set of tools for researchers
and practitioners in the field. This library enables the application of
classical machine learning algorithms to quantum computing, bridging
the gap between the two domains and accelerating the development of
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/01_ngem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"from qiskit.quantum_info import SparsePauliOp\n",
"from qiskit.primitives import BackendEstimator, Estimator\n",
"\n",
"from blackwater.data.encoders.graph_utils import ExpValData\n",
"from blackwater.data.dataio import ExpValDataWriter"
"from ml_qem.data.encoders.graph_utils import ExpValData\n",
"from ml_qem.data.dataio import ExpValDataWriter"
]
},
{
Expand Down Expand Up @@ -155,7 +155,7 @@
"\n",
"import glob\n",
"from torch_geometric.loader import DataLoader\n",
"from blackwater.data.loaders.dataclasses import ExpValDataSet\n",
"from ml_qem.data.loaders.dataclasses import ExpValDataSet\n",
"\n",
"paths = glob.glob(f\"{data_folder}/**.json\")\n",
"split = int(0.6 * len(paths))\n",
Expand All @@ -180,7 +180,7 @@
"source": [
"# create model\n",
"\n",
"from blackwater.library.ngem import SimpleExpectationValueModel\n",
"from ml_qem.library.ngem import SimpleExpectationValueModel\n",
"\n",
"model = SimpleExpectationValueModel(\n",
" num_node_features=22, \n",
Expand Down Expand Up @@ -400,12 +400,12 @@
"source": [
"# estimator\n",
"\n",
"from blackwater.primitives.learning_esimator import (\n",
"from ml_qem.primitives.learning_esimator import (\n",
" learning_estimator,\n",
" ScikitLearnEstimatorModel,\n",
" TorchGeometricEstimatorModel,\n",
")\n",
"from blackwater.data.encoders.graph_utils import DefaultPyGEstimatorEncoder\n",
"from ml_qem.data.encoders.graph_utils import DefaultPyGEstimatorEncoder\n",
"\n",
"\n",
"circuit = transpile(random_circuit(5, 2), fake_lima)\n",
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions blackwater/data/__init__.py → ml_qem/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
=============================
Data (:mod:`blackwater.data`)
=============================
=========================
Data (:mod:`ml_qem.data`)
=========================
.. currentmodule:: blackwater.data
.. currentmodule:: ml_qem.data
Circuit encoders
================
Expand Down
4 changes: 2 additions & 2 deletions blackwater/data/core.py → ml_qem/data/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def encode(self, node: DAGNode, **kwargs) -> List[float]: # type: ignore

# pylint: disable=no-member
@dataclass
class BlackwaterData:
"""BlackwaterData."""
class MLQEMData:
"""MLQEMData."""

def serialize(self) -> dict:
"""Serialize class data to dictionary"""
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import json
from typing import List

from blackwater.data.core import BlackwaterData
from blackwater.data.encoders.graph_utils import ExpValData
from ml_qem.data.core import MLQEMData
from ml_qem.data.encoders.graph_utils import ExpValData


# pylint: disable=unspecified-encoding
class Writer:
"""Base writer class."""

def save_to_file(self, path: str, data: List[BlackwaterData]):
def save_to_file(self, path: str, data: List[MLQEMData]):
"""Writes data to file.
Args:
Expand All @@ -24,7 +24,7 @@ def save_to_file(self, path: str, data: List[BlackwaterData]):
class Reader:
"""Base reader class."""

def read_from_file(self, path: str) -> List[BlackwaterData]:
def read_from_file(self, path: str) -> List[MLQEMData]:
"""Reads from file.
Args:
Expand All @@ -39,15 +39,15 @@ def read_from_file(self, path: str) -> List[BlackwaterData]:
class ExpValDataWriter(Writer):
"""ExpValDataWriter."""

def save_to_file(self, path: str, data: List[BlackwaterData]):
def save_to_file(self, path: str, data: List[MLQEMData]):
with open(path, "w") as file:
json.dump([entry.serialize() for entry in data], file, indent=4)


class ExpValDataReader(Reader):
"""ExpValDataReader."""

def read_from_file(self, path: str) -> List[BlackwaterData]:
def read_from_file(self, path: str) -> List[MLQEMData]:
result = []
with open(path, "r") as file:
json_data = json.load(file)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from qiskit.transpiler import Target
from torch_geometric.data import Data

from blackwater.data.core import DataEncoder, BlackwaterData, NodeEncoder
from blackwater.data.encoders.utils import OperatorData, encode_operator
from blackwater.exception import BlackwaterException
from ml_qem.data.core import DataEncoder, MLQEMData, NodeEncoder
from ml_qem.data.encoders.utils import OperatorData, encode_operator
from ml_qem.exception import MLQEMException

N_QUBIT_PROPERTIES = 2
ALL_INSTRUCTIONS = list(get_standard_gate_name_mapping().keys())
Expand Down Expand Up @@ -106,7 +106,7 @@ def extract_properties_from_backend(
return BackendProperties(qubit_properties_map)

else:
raise BlackwaterException(
raise MLQEMException(
f"Backend of type [{type(backend)}] is not supported yet."
)

Expand Down Expand Up @@ -145,7 +145,7 @@ def encode(self, node: DAGNode, **kwargs) -> List[float]: # type: ignore
params_encoding[i] = float(param._symbol_expr)

if node.op.name not in self.encoding_map:
raise BlackwaterException(
raise MLQEMException(
f"Instruction [{node.op.name}] is not available"
f" for backend [{self.backend.name}]. "
f"Maybe you forgot to transpile circuit for this backend?"
Expand Down Expand Up @@ -234,7 +234,7 @@ def backend_to_json_graph(backend: Union[BackendV1, BackendV2]) -> GraphData:
dictionary with encoded data as graph
"""
if isinstance(backend, BackendV1):
raise BlackwaterException("BackendV1 is not supported yet.")
raise MLQEMException("BackendV1 is not supported yet.")

target: Target = backend.target

Expand All @@ -252,7 +252,7 @@ def backend_to_json_graph(backend: Union[BackendV1, BackendV2]) -> GraphData:


@dataclass
class PygData(BlackwaterData):
class PygData(MLQEMData):
"""PygData."""

@classmethod
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d7e4411

Please sign in to comment.