Skip to content

Commit

Permalink
Switch from qiskit-terra to qiskit (#1229)
Browse files Browse the repository at this point in the history
* Switch from qiskit-terra to qiskit

* Update CONTRIBUTING.md

Co-authored-by: Steve Wood <[email protected]>

---------

Co-authored-by: Max Rossmannek <[email protected]>
  • Loading branch information
woodsp-ibm and mrossinek authored Sep 4, 2023
1 parent 0d112d3 commit b4e07f7
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 88 deletions.
34 changes: 17 additions & 17 deletions .github/actions/install-main-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,39 @@ inputs:
use-conda:
description: 'Use conda'
required: true
terra-main:
description: 'Use Terra main'
qiskit-main:
description: 'Use Qiskit main'
required: true
runs:
using: "composite"
steps:
- name: Get main last commit ids
run: |
echo "TERRA_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-terra.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
echo "QISKIT_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Terra Cache
- name: Qiskit Cache
env:
CACHE_VERSION: v1
id: terra-cache
id: qiskit-cache
uses: actions/cache@v3
with:
path: terra-cache
key: terra-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.TERRA_HASH }}-${{ env.CACHE_VERSION }}
- name: Install Terra from Main
path: qiskit-cache
key: qiskit-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.QISKIT_HASH }}-${{ env.CACHE_VERSION }}
- name: Install Qiskit from Main
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
run: |
if [ "${{ inputs.terra-main }}" == "true" ]; then
echo 'Install Terra from Main'
if [ "${{ inputs.qiskit-main }}" == "true" ]; then
echo 'Install Qiskit from Main'
if [ "${{ inputs.use-conda }}" == "true" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate psi4env
else
pip install wheel
fi
BASE_DIR=terra-cache
BASE_DIR=qiskit-cache
build_from_main=true
cache_hit=${{ steps.terra-cache.outputs.cache-hit }}
cache_hit=${{ steps.qiskit-cache.outputs.cache-hit }}
echo "cache hit: ${cache_hit}"
if [ "$cache_hit" == "true" ]; then
pip_result=0
Expand All @@ -70,23 +70,23 @@ runs:
if [ "$build_from_main" == "true" ]; then
echo 'Create wheel file from main'
pip install -U setuptools_rust
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-terra.git /tmp/qiskit-terra
pushd /tmp/qiskit-terra
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit.git /tmp/qiskit
pushd /tmp/qiskit
python setup.py bdist_wheel
popd
cp -rf /tmp/qiskit-terra/dist/*.whl "${BASE_DIR}"
cp -rf /tmp/qiskit/dist/*.whl "${BASE_DIR}"
pushd "${BASE_DIR}"
python -m pip install *.whl
popd
pip uninstall -y setuptools_rust
fi
else
echo 'Install Terra from Stable'
echo 'Install Qiskit from Stable'
if [ "${{ inputs.use-conda }}" == "true" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate psi4env
fi
pip install -U qiskit-terra
pip install -U qiskit
fi
shell: bash
- name: Install stable Aer
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
use-conda: "true"
terra-main: "false"
qiskit-main: "false"
if: ${{ !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
- uses: ./.github/actions/install-nature
with:
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/neko.yml

This file was deleted.

54 changes: 9 additions & 45 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,7 @@ please ensure that:

### Changelog generation

The changelog is automatically generated as part of the release process
automation. This works through a combination of the git log and the pull
request. When a release is tagged and pushed to github the release automation
bot looks at all commit messages from the git log for the release. It takes the
PR numbers from the git log (assuming a squash merge) and checks if that PR had
a `Changelog:` label on it. If there is a label it will add the git commit
message summary line from the git log for the release to the changelog.

If there are multiple `Changelog:` tags on a PR the git commit message summary
line from the git log will be used for each changelog category tagged.

The current categories for each label are as follows:

| PR Label | Changelog Category |
| -----------------------|--------------------|
| Changelog: Deprecation | Deprecated |
| Changelog: New Feature | Added |
| Changelog: API Change | Changed |
| Changelog: Removal | Removed |
| Changelog: Bugfix | Fixed |
A changelog is manually generated as part of the release process from the release notes.

### Release Notes

Expand Down Expand Up @@ -201,8 +182,8 @@ deprecations:
You can also look at other release notes for other examples.
You can use any restructured text feature in them (code sections, tables,
enumerated lists, bulleted list, etc) to express what is being changed as
needed. In general you want the release notes to include as much detail as
enumerated lists, bulleted list, etc.) to express what is being changed as
needed. In general, you want the release notes to include as much detail as
needed so that users will understand what has changed, why it changed, and how
they'll have to update their code.
Expand Down Expand Up @@ -244,10 +225,8 @@ particular will be located at `docs/_build/html/release_notes.html`
Please see the [Installing Qiskit Nature from
Source](https://github.com/qiskit-community/qiskit-nature#installation)

Note: Nature depends on Terra, and has optional dependence on Aer and IBM Q Provider, so
these should be installed too. The main branch of Nature is kept working with those other element
main branches so these should be installed from source too following the instructions at
the same location
Note: Nature depends on Qiskit, and has an optional dependence on Aer so that
should be installed too.

Nature also has some other optional dependents see
[Nature optional installs](https://github.com/qiskit-community/qiskit-nature#optional-installs) for
Expand All @@ -265,12 +244,12 @@ The test suite can be run from a command line or via your IDE. You can run `make
run all unit tests. Another way to run the test suite is to use
[**tox**](https://tox.readthedocs.io/en/latest/#). For more information about using tox please
refer to
[Terra CONTRIBUTING](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#test)
[Qiskit CONTRIBUTING](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#test)
Test section. However please note Nature does not have any
[online tests](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#online-tests)
[online tests](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#online-tests)
nor does it have
[test skip
options](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#test-skip-options).
options](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#test-skip-options).

### Development Cycle

Expand All @@ -293,24 +272,9 @@ stable and the only changes merged to it are bugfixes.

### Release Cycle

From time to time, we will release brand new versions of Qiskit Nature. These
From time to time, we will release brand-new versions of Qiskit Nature. These
are well-tested versions of the software.

When the time for a new release has come, we will:

1. Create a new tag with the version number and push it to github
2. Change the `main` version to the next release version.

The release automation processes will be triggered by the new tag and perform
the following steps:

1. Create a stable branch for the new minor version from the release tag
on the `main` branch
2. Build and upload binary wheels to pypi
3. Create a github release page with a generated changelog
4. Generate a PR on the meta-repository to bump the terra version and
meta-package version.

The `stable/*` branches should only receive changes in the form of bug
fixes.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The code comprises various modules revolving around:
- second-quantized operator construction and manipulation
- translating from the second-quantized to the qubit space
- a quantum circuit library of natural science targeted ansatze
- natural science specific algorithms and utilities to make the use of Qiskit
Terra's algorithms easier
- natural science specific algorithms and utilities to make the use of
algorithms from [Qiskit Algorithms](https://qiskit.org/ecosystem/algorithms/) easier
- and much more

## Installation
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The code comprises various modules revolving around:
- second-quantized operator construction and manipulation
- translating from the second-quantized to the qubit space
- a quantum circuit library of natural science targeted ansatze
- natural science specific algorithms and utilities to make the use of Qiskit
Terra's algorithms easier
- natural science specific algorithms and utilities to make the use of
algorithms from `Qiskit Algorithms <https://qiskit.org/ecosystem/algorithms/>`_ easier
- and much more


Expand Down
2 changes: 1 addition & 1 deletion qiskit_nature/second_q/circuit/library/ansatzes/ucc.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def _build_fermionic_excitation_ops(self, excitations: Sequence) -> list[Fermion
op = FermionicOp({" ".join(label): 1}, num_spin_orbitals=num_spin_orbitals)
op_adj = op.adjoint()
# we need to account for an additional imaginary phase in the exponent accumulated from
# the first-order trotterization routine implemented in Qiskit Terra
# the first-order trotterization routine implemented in Qiskit
op_minus = 1j * (op - op_adj)
operators.append(op_minus)

Expand Down
2 changes: 1 addition & 1 deletion qiskit_nature/second_q/circuit/library/ansatzes/uvcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def _build_vibration_excitation_ops(self, excitations: Sequence) -> list[Vibrati
op = VibrationalOp({" ".join(label): 1}, self.num_modals)
op -= op.adjoint()
# we need to account for an additional imaginary phase in the exponent accumulated from
# the first-order trotterization routine implemented in Qiskit Terra
# the first-order trotterization routine implemented in Qiskit
op *= 1j # type: ignore
operators.append(op)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
qiskit-terra>=0.24
qiskit>=0.44
scipy>=1.4
numpy>=1.17
psutil>=5
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ setenv =
LANGUAGE=en_US
LC_ALL=en_US.utf-8
ARGS="-V"
deps = git+https://github.com/Qiskit/qiskit-terra.git
deps = git+https://github.com/Qiskit/qiskit.git
git+https://github.com/Qiskit/qiskit-aer.git
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
Expand Down

0 comments on commit b4e07f7

Please sign in to comment.