Skip to content

Commit

Permalink
Update v2 (#54)
Browse files Browse the repository at this point in the history
* bugfix for V1

* formatting

---------

Co-authored-by: oscar-wallis <[email protected]>
  • Loading branch information
OkuyanBoga and oscar-wallis authored Nov 8, 2024
1 parent a04a3e7 commit 2c54cbe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def _run_unique(

elif isinstance(self._estimator, BaseEstimatorV2):
isa_g_circs = self._pass_manager.run(job_circuits)
isa_g_observables = [op.apply_layout(isa_g_circs[i].layout) for i, op in enumerate(job_observables)]
isa_g_observables = [
op.apply_layout(isa_g_circs[i].layout) for i, op in enumerate(job_observables)
]
# Prepare circuit-observable-parameter tuples (PUBs)
circuit_observable_params = []
for pub in zip(isa_g_circs, isa_g_observables, job_param_values):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _call(

if local:
raw_fidelities = [
ComputeUncompute._get_local_fidelity(prob_dist, num_virtual_qubits)
ComputeUncompute._get_local_fidelity(prob_dist, num_virtual_qubits if isinstance(_sampler, BaseSamplerV2) else circuit.num_qubits)
for prob_dist, circuit in zip(quasi_dists, circuits)
]
else:
Expand Down
38 changes: 22 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
import os
import re

with open('requirements.txt') as f:
with open("requirements.txt") as f:
REQUIREMENTS = f.read().splitlines()

if not hasattr(setuptools, 'find_namespace_packages') or not inspect.ismethod(setuptools.find_namespace_packages):
print("Your setuptools version:'{}' does not support PEP 420 (find_namespace_packages). "
"Upgrade it to version >='40.1.0' and repeat install.".format(setuptools.__version__))
if not hasattr(setuptools, "find_namespace_packages") or not inspect.ismethod(
setuptools.find_namespace_packages
):
print(
"Your setuptools version:'{}' does not support PEP 420 (find_namespace_packages). "
"Upgrade it to version >='40.1.0' and repeat install.".format(setuptools.__version__)
)
sys.exit(1)

VERSION_PATH = os.path.join(os.path.dirname(__file__), "qiskit_machine_learning", "VERSION.txt")
Expand All @@ -39,15 +43,15 @@
)

setuptools.setup(
name='qiskit-machine-learning',
name="qiskit-machine-learning",
version=VERSION,
description='Qiskit Machine Learning: A library of quantum computing machine learning experiments',
description="Qiskit Machine Learning: A library of quantum computing machine learning experiments",
long_description=README,
long_description_content_type="text/markdown",
url='https://github.com/qiskit-community/qiskit-machine-learning',
author='Qiskit Machine Learning Development Team',
author_email='[email protected]',
license='Apache-2.0',
url="https://github.com/qiskit-community/qiskit-machine-learning",
author="Qiskit Machine Learning Development Team",
author_email="[email protected]",
license="Apache-2.0",
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
Expand All @@ -61,21 +65,23 @@
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering"
"Topic :: Scientific/Engineering",
],
keywords='qiskit sdk quantum machine learning ml',
packages=setuptools.find_packages(include=['qiskit_machine_learning','qiskit_machine_learning.*']),
keywords="qiskit sdk quantum machine learning ml",
packages=setuptools.find_packages(
include=["qiskit_machine_learning", "qiskit_machine_learning.*"]
),
install_requires=REQUIREMENTS,
include_package_data=True,
python_requires=">=3.9",
extras_require={
'torch': ["torch"],
'sparse': ["sparse"],
"torch": ["torch"],
"sparse": ["sparse"],
},
project_urls={
"Bug Tracker": "https://github.com/qiskit-community/qiskit-machine-learning/issues",
"Documentation": "https://qiskit-community.github.io/qiskit-machine-learning/",
"Source Code": "https://github.com/qiskit-community/qiskit-machine-learning",
},
zip_safe=False
zip_safe=False,
)

0 comments on commit 2c54cbe

Please sign in to comment.