Skip to content

Commit

Permalink
Move metapackage shim for combined releases (#10530)
Browse files Browse the repository at this point in the history
* Move metapackage shim for combined releases

Now that Qiskit 0.44.0 has been released, the Qiskit project is now what
was formerly qiskit-terra. However, because Python packaging lacks a
clean mechanism to enable one package superseding another we're not able
to stop shipping a qiskit-terra package that owns the qiskit python
namespace without introducing a lot of potential user friction. So
moving forward the qiskit project will release 2 packages an inner
qiskit-terra which still contains all the library code and public facing
qiskit package which installs that inner package  only. To enable this
workflow this commit migrates the metapackage setup.py into the terra
repository and setups build automation to publish a qiskit package in
addition to the inner terra package on each release tag.

* some follow up on #10530 (#19)

* some follow up on #10530

  * extend some badges
  * This Qiskit contains the building blocks for creating and working with quantum circuits, programs, and algorithms. -> This framework allows for building, transforming, and visualizing quantum circuits.
  * The explanation of the Bell state is moving to IBM Quantun learning platform
  * I think examples/ should eventually be replaced by proper tutorials
  * Add StackOverflow as a forum
  * Remove link to https://github.com/Qiskit/qiskit-tutorials

* Update README.md

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Update README.md

* Update README.md

* broken lines in badges

* doi

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Expand lint checks to entire qiskit_pkg dir

* Unify extras in terra setup.py

* Update CI lint job

* Remove unused json imports

* Cleanup manifest file

* Finish comment

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
(cherry picked from commit 8a180ee)

# Conflicts:
#	README.md
  • Loading branch information
mtreinish authored and mergify[bot] committed Aug 15, 2023
1 parent ef8ae34 commit 2b499ed
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .azure/lint-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
set -e
source test-job/bin/activate
echo "Running black, any errors reported can be fixed with 'tox -eblack'"
black --check qiskit test tools examples setup.py
black --check qiskit test tools examples setup.py qiskit_pkg
echo "Running rustfmt check, any errors reported can be fixed with 'cargo fmt'"
cargo fmt --check
displayName: "Formatting"
Expand All @@ -44,7 +44,7 @@ jobs:
set -e
source test-job/bin/activate
echo "Running ruff"
ruff qiskit test tools examples setup.py
ruff qiskit test tools examples setup.py qiskit_pkg/setup.py
echo "Running pylint"
pylint -rn qiskit test tools
echo "Running Cargo Clippy"
Expand Down
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
<<<<<<< HEAD
# Qiskit Terra
[![License](https://img.shields.io/github/license/Qiskit/qiskit-terra.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)<!--- long-description-skip-begin -->[![Release](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=popout-square)](https://github.com/Qiskit/qiskit-terra/releases)[![Downloads](https://img.shields.io/pypi/dm/qiskit-terra.svg?style=popout-square)](https://pypi.org/project/qiskit-terra/)[![Coverage Status](https://coveralls.io/repos/github/Qiskit/qiskit-terra/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-terra?branch=main)[![Minimum rustc 1.61.0](https://img.shields.io/badge/rustc-1.61.0+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)<!--- long-description-skip-end -->
=======
# Qiskit
[![License](https://img.shields.io/github/license/Qiskit/qiskit-terra.svg?)](https://opensource.org/licenses/Apache-2.0) <!--- long-description-skip-begin -->
[![Release](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg)](https://github.com/Qiskit/qiskit-terra/releases)
[![Downloads](https://img.shields.io/pypi/dm/qiskit-terra.svg)](https://pypi.org/project/qiskit-terra/)
[![Coverage Status](https://coveralls.io/repos/github/Qiskit/qiskit-terra/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-terra?branch=main)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qiskit)
[![Minimum rustc 1.64.0](https://img.shields.io/badge/rustc-1.64.0+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![Downloads](https://pepy.tech/badge/qiskit-terra)](https://pypi.org/project/qiskit-terra/)<!--- long-description-skip-end -->
[![DOI](https://zenodo.org/badge/161550823.svg)](https://zenodo.org/badge/latestdoi/161550823)
>>>>>>> 8a180ee8d (Move metapackage shim for combined releases (#10530))
**Qiskit** is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.

This library is the core component of Qiskit, **Terra**, which contains the building blocks for creating
and working with quantum circuits, programs, and algorithms. It also contains a compiler that supports
This framework allows for building, transforming, and visualizing quantum circuits. It also contains a compiler that supports
different quantum computers and a common interface for running programs on different quantum computer architectures.

For more details on how to use Qiskit you can refer to the documentation located here:

https://qiskit.org/documentation/
<https://qiskit.org/documentation/>


## Installation

We encourage installing Qiskit via ``pip``. The following command installs the core Qiskit components, including Terra.
We encourage installing Qiskit via ``pip``:

```bash
pip install qiskit
Expand All @@ -24,7 +35,7 @@ Pip will handle all dependencies automatically and you will always install the l

To install from source, follow the instructions in the [documentation](https://qiskit.org/documentation/contributing_to_qiskit.html#install-install-from-source-label).

## Creating Your First Quantum Program in Qiskit Terra
## Creating Your First Quantum Program in Qiskit

Now that Qiskit is installed, it's time to begin working with Qiskit. To do this
we create a `QuantumCircuit` object to define a basic quantum program.
Expand All @@ -37,7 +48,7 @@ qc.cx(0, 1)
qc.measure([0,1], [0,1])
```

This simple example makes an entangled state, also called a [Bell state](https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html#3.2-Entangled-States-).
This example makes an entangled state, also called a [Bell state](https://en.wikipedia.org/wiki/Bell_state).

Once you've made your first quantum circuit, you can then simulate it.
To do this, first we need to compile your circuit for the target backend we're going to run
Expand Down Expand Up @@ -66,12 +77,9 @@ The output from this execution will look similar to this:
{'00': 513, '11': 511}
```

For further examples of using Qiskit you can look at the example scripts in **examples/python**. You can start with
[using_qiskit_terra_level_0.py](examples/python/using_qiskit_terra_level_0.py) and working up in the levels. Also
you can refer to the tutorials in the documentation here:

https://qiskit.org/documentation/tutorials.html
For further examples of using Qiskit you can look at the tutorials in the documentation here:

<https://qiskit.org/documentation/tutorials.html>

### Executing your code on a real quantum chip

Expand All @@ -94,22 +102,18 @@ on how to get access and use these systems.

## Contribution Guidelines

If you'd like to contribute to Qiskit Terra, please take a look at our
[contribution guidelines](CONTRIBUTING.md). This project adheres to Qiskit's [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
If you'd like to contribute to Qiskit, please take a look at our
[contribution guidelines](CONTRIBUTING.md). By participating, you are expected to uphold our [code of conduct](CODE_OF_CONDUCT.md).

We use [GitHub issues](https://github.com/Qiskit/qiskit-terra/issues) for tracking requests and bugs. Please
[join the Qiskit Slack community](https://qisk.it/join-slack)
and use our [Qiskit Slack channel](https://qiskit.slack.com) for discussion and simple questions.
For questions that are more suited for a forum we use the `qiskit` tag in the [Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).

## Next Steps
[join the Qiskit Slack community](https://qisk.it/join-slack) for discussion, comments, and questions.
For questions related to running or using Qiskit, [Stack Overflow has a `qiskit`](https://stackoverflow.com/questions/tagged/qiskit).
For questions on quantum computing with Qiskit, use the `qiskit` tag in the [Quantum Computing Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit) (please, read first the [guidelines on how to ask](https://quantumcomputing.stackexchange.com/help/how-to-ask) in that forum).

Now you're set up and ready to check out some of the other examples from our
[Qiskit Tutorials](https://github.com/Qiskit/qiskit-tutorials) repository.

## Authors and Citation

Qiskit Terra is the work of [many people](https://github.com/Qiskit/qiskit-terra/graphs/contributors) who contribute
Qiskit is the work of [many people](https://github.com/Qiskit/qiskit-terra/graphs/contributors) who contribute
to the project at different levels. If you use Qiskit, please cite as per the included [BibTeX file](CITATION.bib).

## Changelog and Release Notes
Expand All @@ -118,10 +122,10 @@ The changelog for a particular release is dynamically generated and gets
written to the release page on Github for each release. For example, you can
find the page for the `0.9.0` release here:

https://github.com/Qiskit/qiskit-terra/releases/tag/0.9.0
<https://github.com/Qiskit/qiskit-terra/releases/tag/0.9.0>

The changelog for the current release can be found in the releases tab:
[![Releases](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=popout-square)](https://github.com/Qiskit/qiskit-terra/releases)
[![Releases](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=flat&label=)](https://github.com/Qiskit/qiskit-terra/releases)
The changelog provides a quick overview of notable changes for a given
release.

Expand Down
18 changes: 18 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,21 @@ stages:
env:
TWINE_USERNAME: "qiskit"
TWINE_PASSWORD: $(TWINE_PASSWORD)
- job: 'qiskit-pkg'
pool: {vmImage: 'ubuntu-latest'}
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip build
cd qiskit_pkg
python -m build .
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'dist'}
condition: succeededOrFailed()
- bash: |
python -m pip install --upgrade twine
twine upload dist/*
env:
TWINE_USERNAME: "qiskit"
TWINE_PASSWORD: $(TWINE_PASSWORD)
1 change: 1 addition & 0 deletions qiskit_pkg/LICENSE.txt
1 change: 1 addition & 0 deletions qiskit_pkg/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include LICENSE.txt
1 change: 1 addition & 0 deletions qiskit_pkg/README.md
73 changes: 73 additions & 0 deletions qiskit_pkg/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-

# This code is part of Qiskit.
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# This file is the setup.py file for the qiskit package. Because python
# packaging doesn't offer a mechanism to have qiskit supersede qiskit-terra
# and cleanly upgrade from one to the other, there needs to be a separate
# package shim to ensure no matter how people installed qiskit < 0.45.0 the
# upgrade works.

import os

from setuptools import setup

README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md")
with open(README_PATH) as readme_file:
README = readme_file.read()

requirements = ["qiskit-terra==0.45.0"]

setup(
name="qiskit",
version="0.45.0",
description="Software for developing quantum computing programs",
long_description=README,
long_description_content_type="text/markdown",
url="https://qiskit.org/",
author="Qiskit Development Team",
author_email="hello@qiskit.org",
license="Apache 2.0",
py_modules=[],
packages=[],
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
],
keywords="qiskit sdk quantum",
install_requires=requirements,
project_urls={
"Bug Tracker": "https://github.com/Qiskit/qiskit/issues",
"Documentation": "https://qiskit.org/documentation/",
"Source Code": "https://github.com/Qiskit/qiskit",
},
include_package_data=True,
python_requires=">=3.8",
extras_require={
"qasm3-import": ["qiskit-terra[qasm3-import]"],
"visualization": ["qiskit-terra[visualization]"],
"crosstalk-pass": ["qiskit-terra[crosstalk-pass]"],
"csp-layout-pass": ["qiskit-terra[csp-layout-pass]"],
"all": ["qiskit-terra[all]"],
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
upgrade:
- |
The ``toqm`` optional setuptools extra that previously enabled running
``pip install qiskit-terra[topm]`` has been removed as nothing in the
Qiskit code base is currently using that package anymore. If you'd like
to use the qiskit TOQM transpiler plugin you should install the
``qiskit-toqm`` package directly.
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@
z3_requirements = [
"z3-solver>=4.7",
]
bip_requirements = ["cplex", "docplex"]
csp_requirements = ["python-constraint>=1.4"]
toqm_requirements = ["qiskit-toqm>=0.1.0"]


setup(
name="qiskit-terra",
Expand Down Expand Up @@ -89,12 +88,8 @@
extras_require={
"qasm3-import": qasm3_import_extras,
"visualization": visualization_extras,
"bip-mapper": bip_requirements,
"crosstalk-pass": z3_requirements,
"csp-layout-pass": csp_requirements,
"toqm": toqm_requirements,
# Note: 'all' only includes extras that are stable and work on the majority of Python
# versions and OSes supported by Terra. You have to ask for anything else explicitly.
"all": visualization_extras + z3_requirements + csp_requirements + qasm3_import_extras,
},
project_urls={
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ commands =
[testenv:lint]
basepython = python3
commands =
ruff check qiskit test tools examples setup.py
black --check {posargs} qiskit test tools examples setup.py
ruff check qiskit test tools examples setup.py qiskit_pkg
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
pylint -rn qiskit test tools
# This line is commented out until #6649 merges. We can't run this currently
# via tox because tox doesn't support globbing
Expand All @@ -39,8 +39,8 @@ commands =
basepython = python3
allowlist_externals = git
commands =
ruff check qiskit test tools examples setup.py
black --check {posargs} qiskit test tools examples setup.py
ruff check qiskit test tools examples setup.py qiskit_pkg
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
-git fetch -q https://github.com/Qiskit/qiskit-terra.git :lint_incr_latest
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --paths :/qiskit/*.py :/test/*.py :/tools/*.py
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --disable='invalid-name,missing-module-docstring,redefined-outer-name' --paths :(glob,top)examples/python/*.py
Expand All @@ -50,7 +50,7 @@ commands =
reno lint

[testenv:black]
commands = black {posargs} qiskit test tools examples setup.py
commands = black {posargs} qiskit test tools examples setup.py qiskit_pkg

[testenv:coverage]
basepython = python3
Expand Down

0 comments on commit 2b499ed

Please sign in to comment.