Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable parallelism on tutorials job, refactor CI #56

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

manoelmarques
Copy link
Contributor

Summary

Tutorials fail randomly due to Jupyter bug: jupyter/jupyter_client#541
This PR disables parallelism on tutorials by setting env: QISKIT_PARALLEL=False
Also, the CI has been streamlined.

Details and comments

@manoelmarques manoelmarques added the type: bug Something isn't working label Feb 17, 2021
@manoelmarques manoelmarques self-assigned this Feb 17, 2021
@manoelmarques manoelmarques merged commit f9b5b59 into qiskit-community:master Feb 17, 2021
@manoelmarques manoelmarques deleted the parallel branch February 17, 2021 17:08
pbark pushed a commit that referenced this pull request Mar 4, 2021
* MolecularProblem class introduced with a dummy unit test. Changed transformers signatures.

* Folder structure fixed.

* Code refactoring.

* Basic auxiliary fermionic operators added to MolecularProblem class.

* Dipole operators added to MolecularProblem class. Extended and refactored the unit test.

* Improved naming.

* Code refactoring.

* Docs added.

* Unit tests added.

* Fixed imports.

* Fixed imports for psi4.

* Fix QMolecule imports in docs

* fix docs

* Docs fixed.

* Code refactoring as per PR feedback.

* Moved driver running out of constructor in MolecularProblem.

* Import order fix.

* Introduced relative imports.

* Imports improved.

* Imports improved.

* MolecularProblem class introduced with a dummy unit test. Changed transformers signatures.

* Folder structure fixed.

* Code refactoring.

* Basic auxiliary fermionic operators added to MolecularProblem class.

* Dipole operators added to MolecularProblem class. Extended and refactored the unit test.

* Improved naming.

* Code refactoring.

* Docs added.

* Unit tests added.

* Fixed imports.

* Fixed imports for psi4.

* Fix Github Actions (#37)

* Update Alejandro Pozas-Kerstjens' details (#36)

Corrected name and changed canonical email of @apozas.

Co-authored-by: Manoel Marques <[email protected]>

* Improve StarAlgebra (#38)

* improve StarAlgebra

* fix wrong type hint

* fix type hint

Co-authored-by: Panagiotis Barkoutsos <[email protected]>

* Some FermionicOp speed-improvements (#34)

* Do zero-operator check asap.

Rather than first computing the number of commutations we can always
perform the check whether we end up with a zero-operator first. This
saves us a number of computations in some scenarios.

Benchmark prior to this commit:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 42 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 88.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 20.7 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 118 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 101 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 64.1 usec per loop
```

And after:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 43.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 88.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 18.9 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 119 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 22.7 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 97.8 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 59.9 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Leverage list indexing.

Strings in Python are immutable which means that whenever you append to
a String you actually need to construct a new one. Since this is not
really necessary here, we can instead construct the label from a list
and only convert it to a string in the end.
We also don't need to cast the `new_char` as we have handled the only
`int`-based case by the if-statement.

New benchmark results:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 37.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 80.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 22.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 111 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 86.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 54.4 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Precompute the number of commutations.

Rather than re-computing the number of commutations within each for-loop
iteration, we can store the total count ahead of time and adapt it as we
progress. Furthermore, since we really only care about the parity, we
only need to update the coefficient if `count` is odd.

This results in a speedup of almost x2 compared to before:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 40.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 46.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 20.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 55.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 54.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 51.4 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Fix lint and mypy

Co-authored-by: 1ucian0 <[email protected]>
Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Panagiotis Barkoutsos <[email protected]>

* Re-organize unit tests along folder structure as per code (#41)

* Fix QMolecule imports in docs

* fix docs

* Docs fixed.

* Code refactoring as per PR feedback.

* Moved driver running out of constructor in MolecularProblem.

* Import order fix.

* Disable parallel CI tutorials run (#56)

* Introduced relative imports.

* Imports improved.

* Imports improved.

* Optimization and cleanup of FermionicOp (#58)

* optimize _single_mul
* optimize adjoint
* optimize _validate_label
* add a unit test for invalid labels

* Comply with pylint 2.7.0 (#61)

* Use generators to comply with pylint 2.7.0

Since pylint 2.7.0, generators are being suggested whenever possible
[1]. This commit makes Qiskit Nature comply with that.

[1]: https://github.com/PyCQA/pylint/blob/master/ChangeLog#L182-L188

* Add h5py.Group to ignored pylint classes

Since pylint 2.7.0 the following errors occur:

qiskit_nature/qmolecule.py:203:43: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:207:42: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:211:49: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:213:44: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:217:48: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:219:63: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:223:49: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:225:46: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:227:45: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:236:53: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:238:49: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:240:46: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:586:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:589:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:597:51: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:600:56: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:603:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:606:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:609:49: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:613:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:616:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:620:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:623:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:626:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:630:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:633:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:636:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:640:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:643:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:646:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:649:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:652:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:655:59: E1101: Instance of 'Group' has no 'shape' member (no-member)

I am unsure what exactly causes these because in all cases, the type
should actually be a numpy array or an h5py.Database and not a Group.
Thus, I am adding this class to the ignored ones for the time being.

* Docs on chemist notation added.

* Imports fixed.

* MolecularProblem unit test added with a transformer.

* Code refactoring. Improved tests.

* Code refactoring.

* Code refactoring.

* Unit tests for integrals calculator extended.

* Integrals calculator return type unified.

* fermionic_op_builder.py fixed. Type hints added.

* angular_momentum_integrals_calculator.py code duplication removed.

* Added detailed fermionic_op_builder.py tests.

* Improved wording in fermionic_op_builder.py docs.

* Deleted a dummy label from fermionic_op_builder.py.

* Extracted test_fermionic_op_builder.py expected data to files.

* Reintroduced a dummy label in fermionic_op_builder.py to avoid fails (to be addressed later).

* Docs extended for order of operators.

* Added raw files for test_molecular_problem.py

* Subtests introduced.

* Tests fixed.

* fixes lint

* Ddt introduced in unit tests.

* Dummy label coeff set to 0.

* Comments added.

* Spelling fixed.

Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Panagiotis Barkoutsos <[email protected]>
Co-authored-by: Alex Pozas-Kerstjens <[email protected]>
Co-authored-by: Ikko Hamamura <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: 1ucian0 <[email protected]>
Co-authored-by: Takashi Imamichi <[email protected]>
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this pull request May 25, 2023
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this pull request May 25, 2023
* MolecularProblem class introduced with a dummy unit test. Changed transformers signatures.

* Folder structure fixed.

* Code refactoring.

* Basic auxiliary fermionic operators added to MolecularProblem class.

* Dipole operators added to MolecularProblem class. Extended and refactored the unit test.

* Improved naming.

* Code refactoring.

* Docs added.

* Unit tests added.

* Fixed imports.

* Fixed imports for psi4.

* Fix QMolecule imports in docs

* fix docs

* Docs fixed.

* Code refactoring as per PR feedback.

* Moved driver running out of constructor in MolecularProblem.

* Import order fix.

* Introduced relative imports.

* Imports improved.

* Imports improved.

* MolecularProblem class introduced with a dummy unit test. Changed transformers signatures.

* Folder structure fixed.

* Code refactoring.

* Basic auxiliary fermionic operators added to MolecularProblem class.

* Dipole operators added to MolecularProblem class. Extended and refactored the unit test.

* Improved naming.

* Code refactoring.

* Docs added.

* Unit tests added.

* Fixed imports.

* Fixed imports for psi4.

* Fix Github Actions (qiskit-community#37)

* Update Alejandro Pozas-Kerstjens' details (qiskit-community#36)

Corrected name and changed canonical email of @apozas.

Co-authored-by: Manoel Marques <[email protected]>

* Improve StarAlgebra (qiskit-community#38)

* improve StarAlgebra

* fix wrong type hint

* fix type hint

Co-authored-by: Panagiotis Barkoutsos <[email protected]>

* Some FermionicOp speed-improvements (qiskit-community#34)

* Do zero-operator check asap.

Rather than first computing the number of commutations we can always
perform the check whether we end up with a zero-operator first. This
saves us a number of computations in some scenarios.

Benchmark prior to this commit:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 42 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 88.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 20.7 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 118 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 101 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 64.1 usec per loop
```

And after:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 43.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 88.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 18.9 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 119 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 22.7 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 97.8 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 59.9 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Leverage list indexing.

Strings in Python are immutable which means that whenever you append to
a String you actually need to construct a new one. Since this is not
really necessary here, we can instead construct the label from a list
and only convert it to a string in the end.
We also don't need to cast the `new_char` as we have handled the only
`int`-based case by the if-statement.

New benchmark results:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 37.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 80.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 22.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 111 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 86.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 54.4 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Precompute the number of commutations.

Rather than re-computing the number of commutations within each for-loop
iteration, we can store the total count ahead of time and adapt it as we
progress. Furthermore, since we really only care about the parity, we
only need to update the coefficient if `count` is odd.

This results in a speedup of almost x2 compared to before:
```
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('I'*100)"
1000 loops, best of 5: 40.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('I'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 46.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 20.5 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('-'*100)"
1000 loops, best of 5: 55.6 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('+'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 23.2 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('+'*100)"
1000 loops, best of 5: 54.4 usec per loop
python -m timeit -n 1000 -s "from qiskit_nature.operators.second_quantization import FermionicOp" "FermionicOp('N'*100) @ FermionicOp('N'*100)"
1000 loops, best of 5: 51.4 usec per loop
```

Co-authored-by: 1ucian0 <[email protected]>

* Fix lint and mypy

Co-authored-by: 1ucian0 <[email protected]>
Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Panagiotis Barkoutsos <[email protected]>

* Re-organize unit tests along folder structure as per code (qiskit-community#41)

* Fix QMolecule imports in docs

* fix docs

* Docs fixed.

* Code refactoring as per PR feedback.

* Moved driver running out of constructor in MolecularProblem.

* Import order fix.

* Disable parallel CI tutorials run (qiskit-community#56)

* Introduced relative imports.

* Imports improved.

* Imports improved.

* Optimization and cleanup of FermionicOp (qiskit-community#58)

* optimize _single_mul
* optimize adjoint
* optimize _validate_label
* add a unit test for invalid labels

* Comply with pylint 2.7.0 (qiskit-community#61)

* Use generators to comply with pylint 2.7.0

Since pylint 2.7.0, generators are being suggested whenever possible
[1]. This commit makes Qiskit Nature comply with that.

[1]: https://github.com/PyCQA/pylint/blob/master/ChangeLog#L182-L188

* Add h5py.Group to ignored pylint classes

Since pylint 2.7.0 the following errors occur:

qiskit_nature/qmolecule.py:203:43: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:207:42: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:211:49: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:213:44: E1101: Instance of 'Group' has no 'tobytes' member (no-member)
qiskit_nature/qmolecule.py:217:48: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:219:63: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:223:49: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:225:46: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:227:45: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:236:53: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:238:49: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:240:46: E1101: Instance of 'Group' has no 'dtype' member (no-member)
qiskit_nature/qmolecule.py:586:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:589:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:597:51: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:600:56: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:603:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:606:53: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:609:49: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:613:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:616:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:620:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:623:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:626:64: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:630:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:633:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:636:54: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:640:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:643:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:646:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:649:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:652:59: E1101: Instance of 'Group' has no 'shape' member (no-member)
qiskit_nature/qmolecule.py:655:59: E1101: Instance of 'Group' has no 'shape' member (no-member)

I am unsure what exactly causes these because in all cases, the type
should actually be a numpy array or an h5py.Database and not a Group.
Thus, I am adding this class to the ignored ones for the time being.

* Docs on chemist notation added.

* Imports fixed.

* MolecularProblem unit test added with a transformer.

* Code refactoring. Improved tests.

* Code refactoring.

* Code refactoring.

* Unit tests for integrals calculator extended.

* Integrals calculator return type unified.

* fermionic_op_builder.py fixed. Type hints added.

* angular_momentum_integrals_calculator.py code duplication removed.

* Added detailed fermionic_op_builder.py tests.

* Improved wording in fermionic_op_builder.py docs.

* Deleted a dummy label from fermionic_op_builder.py.

* Extracted test_fermionic_op_builder.py expected data to files.

* Reintroduced a dummy label in fermionic_op_builder.py to avoid fails (to be addressed later).

* Docs extended for order of operators.

* Added raw files for test_molecular_problem.py

* Subtests introduced.

* Tests fixed.

* fixes lint

* Ddt introduced in unit tests.

* Dummy label coeff set to 0.

* Comments added.

* Spelling fixed.

Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Panagiotis Barkoutsos <[email protected]>
Co-authored-by: Alex Pozas-Kerstjens <[email protected]>
Co-authored-by: Ikko Hamamura <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: 1ucian0 <[email protected]>
Co-authored-by: Takashi Imamichi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants