Skip to content

Commit

Permalink
Versions: fix qiskit versioning (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceKhan13 authored Apr 5, 2024
1 parent 5161a44 commit 3495722
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 93 deletions.
2 changes: 1 addition & 1 deletion blackwater/data/loaders/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from blackwater.data.dataio import ExpValDataReader


# pylint: disable=abstract-method
class ExpValDataSet(Dataset):
"""ExpValDataLoader."""

Expand Down
42 changes: 21 additions & 21 deletions docs/guides/01_encoders.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"id": "7e59d4a3-8076-49ae-ab90-b04958ce2733",
"metadata": {},
"outputs": [],
"source": [
"from qiskit import QuantumCircuit, transpile\n",
"from qiskit.providers.fake_provider import FakeLimaV2\n",
"\n",
"from blackwater.data.encoders.torch import (\n",
"from blackwater.data.encoders.graph_utils import (\n",
" circuit_to_json_graph, \n",
" backend_to_json_graph, \n",
" BackendNodeEncoder\n",
Expand All @@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "b2c2c043-e0b6-4c8d-8c25-5a8bfad1764d",
"metadata": {},
"outputs": [
Expand All @@ -52,7 +52,7 @@
" 0 1 "
]
},
"execution_count": 3,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -67,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"id": "db427da1-12d6-4c47-9e21-47834b2636c1",
"metadata": {},
"outputs": [
Expand All @@ -77,7 +77,7 @@
"GraphData(nodes=[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.0, 0.0, 0.0]], edges=[[0, 1], [1, 2], [1, 2], [2, 4], [2, 3]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0]])"
]
},
"execution_count": 4,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -89,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 8,
"id": "b372d23a-ae39-47a6-911d-5c323b8e465d",
"metadata": {},
"outputs": [
Expand All @@ -99,7 +99,7 @@
"GraphData(nodes=[[0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [3, 4], [4, 6], [4, 5]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]])"
]
},
"execution_count": 5,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -114,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"id": "74d1d837-0be4-4a32-8558-0ea82a4f29d7",
"metadata": {},
"outputs": [
Expand All @@ -124,7 +124,7 @@
"GraphData(nodes=[[5.9698643286635694e-05, 9.355584184359312e-05, 5029685549.923759], [8.305997230317399e-05, 0.00011553074510239035, 5128321697.435369], [0.00010377694598809795, 9.477169960638749e-05, 5247491310.11471], [4.358447375590962e-05, 4.645933441447346e-05, 5303339662.601714], [1.7543975812787366e-05, 1.6441110002077736e-05, 5091790567.452984]], edges=[[4, 3], [3, 4], [0, 1], [1, 0], [3, 1], [1, 3], [2, 1], [1, 2]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]])"
]
},
"execution_count": 6,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -136,7 +136,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 11,
"id": "1047bf61-566f-458a-a5de-787f16824e62",
"metadata": {},
"outputs": [],
Expand All @@ -146,12 +146,12 @@
"from qiskit.quantum_info import SparsePauliOp\n",
"from torch_geometric.data import Data\n",
"\n",
"from blackwater.data.encoders.torch import ExpValData"
"from blackwater.data.encoders.graph_utils import ExpValData"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"id": "fc1a98e0-d9c6-4c2c-a6e0-5fa85cc5eaec",
"metadata": {},
"outputs": [
Expand All @@ -176,7 +176,7 @@
" 0 1 "
]
},
"execution_count": 8,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -191,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 13,
"id": "aecbe254-2b9b-49f0-a05b-bf73620e46bf",
"metadata": {},
"outputs": [],
Expand All @@ -204,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 14,
"id": "12d5745b-23f2-44e8-872f-0f3c5690e956",
"metadata": {},
"outputs": [
Expand All @@ -214,7 +214,7 @@
"ExpValData(circuit=GraphData(nodes=[[0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [3, 4], [4, 6], [4, 5]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]), circuit_depth=5, expectation_values=[0.0], observable=OperatorData(operator=[[1.0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]]), backend=GraphData(nodes=[[5.9698643286635694e-05, 9.355584184359312e-05, 5029685549.923759], [8.305997230317399e-05, 0.00011553074510239035, 5128321697.435369], [0.00010377694598809795, 9.477169960638749e-05, 5247491310.11471], [4.358447375590962e-05, 4.645933441447346e-05, 5303339662.601714], [1.7543975812787366e-05, 1.6441110002077736e-05, 5091790567.452984]], edges=[[4, 3], [3, 4], [0, 1], [1, 0], [3, 1], [1, 3], [2, 1], [1, 2]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]))"
]
},
"execution_count": 10,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -232,7 +232,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 15,
"id": "31ae08ea-d0f7-44aa-ae1f-35603694b991",
"metadata": {},
"outputs": [
Expand All @@ -242,7 +242,7 @@
"Data(x=[7, 22], edge_index=[2, 7], edge_attr=[7, 1], y=[1, 1], circuit_depth=[1, 1], observable=[1, 1, 13], backend_nodes=[5, 3], backend_edges=[2, 8], backend_edge_features=[8, 1])"
]
},
"execution_count": 11,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -255,7 +255,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "361ead2b-831a-49b7-8b9c-fe89273e9f28",
"id": "3bdd86e6",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -277,7 +277,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.19"
}
},
"nbformat": 4,
Expand Down
22 changes: 11 additions & 11 deletions docs/guides/03_data_io.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"id": "5283f6a6-6131-4518-aff0-5228df3ec2ce",
"metadata": {},
"outputs": [],
Expand All @@ -19,14 +19,14 @@
"from qiskit.providers.fake_provider import FakeLimaV2\n",
"from qiskit.quantum_info import SparsePauliOp\n",
"\n",
"from blackwater.data.encoders.torch import ExpValData\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"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"id": "e75f5374-5632-458a-8b97-7051d0a2f740",
"metadata": {},
"outputs": [
Expand All @@ -51,7 +51,7 @@
" 0 1 "
]
},
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -66,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"id": "d76e0ba4-67d5-4e3f-92c4-052898d0d3df",
"metadata": {},
"outputs": [],
Expand All @@ -79,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"id": "293609ae-43d0-4ddf-a19b-43c84303a0dd",
"metadata": {},
"outputs": [
Expand All @@ -89,7 +89,7 @@
"ExpValData(circuit=GraphData(nodes=[[0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1.5707963267948966, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 5.9698643286635694e-05, 9.355584184359312e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.305997230317399e-05, 0.00011553074510239035, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], edges=[[0, 1], [1, 2], [2, 3], [3, 4], [3, 4], [4, 6], [4, 5]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]), circuit_depth=5, expectation_values=[0.0], observable=OperatorData(operator=[[1.0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]]), backend=GraphData(nodes=[[5.9698643286635694e-05, 9.355584184359312e-05, 5029685549.923759], [8.305997230317399e-05, 0.00011553074510239035, 5128321697.435369], [0.00010377694598809795, 9.477169960638749e-05, 5247491310.11471], [4.358447375590962e-05, 4.645933441447346e-05, 5303339662.601714], [1.7543975812787366e-05, 1.6441110002077736e-05, 5091790567.452984]], edges=[[4, 3], [3, 4], [0, 1], [1, 0], [3, 1], [1, 3], [2, 1], [1, 2]], edge_features=[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]))"
]
},
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"id": "2bb31160-bd1b-429b-b313-29c5f0fe285b",
"metadata": {},
"outputs": [],
Expand All @@ -122,7 +122,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"id": "83d50814-f4c9-4c16-bcae-83bdd61770b1",
"metadata": {},
"outputs": [],
Expand All @@ -133,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"id": "3271e649-3b58-4db0-8bf5-9886fc579831",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -178,7 +178,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.19"
}
},
"nbformat": 4,
Expand Down
18 changes: 5 additions & 13 deletions docs/installation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## PyPi

```shell
pip install blackwater
```
Installation through PyPi is not available

## Local installation

Expand All @@ -15,20 +13,14 @@ pip install blackwater
pip install -r requirements.txt
```

3. Installing Optional Dependencies

```shell
pip install -r requirements-dev.txt
```
4. Installing Blackwater
3. Installing Blackwater

```shell
pip install .
```

5. Testing the Installation
4. Testing the Installation

```shell
tox -epy39
tox -elint
```
Explore `/docs/guides/` or `/docs/tutorials/` notebooks with examples.
```
4 changes: 2 additions & 2 deletions docs/requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ qiskit-terra>=0.21.1
sphinx-copybutton>=0.5.0
qiskit-ibm-runtime==0.9.3
torch>=2.0.1
qiskit-aer>=0.11.0
qiskit-terra>=0.23.1
qiskit-aer>=0.11.0,<=0.13.3
qiskit>=0.23.1,<0.45.1
qiskit-experiments>=0.4.0
Gymnasium>=0.26.3
ray>=2.4.0
Expand Down
Loading

0 comments on commit 3495722

Please sign in to comment.