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

Release 0.6.0 #121

Merged
merged 2 commits into from
Jan 23, 2023
Merged

Release 0.6.0 #121

merged 2 commits into from
Jan 23, 2023

Conversation

pablolh
Copy link

@pablolh pablolh commented Jan 19, 2023

Almost a complete rewrite. No functional change except it's faster.

Added

  • Ability to easily implement any quantum gate by simply giving an arbitrary unitary matrix in Gates.h
  • Performance speedup using a single thread
  • Some proper linear algebra primitives using template metaprogramming
  • Abseil-cpp dependency for flat_hash_map
  • Ability to compile the simulator with an set maximum number of qubits - in the future this will
    be using templates as well to switch data structures based on the input quantum circuit

Changed

  • Quantum state is stored as a sparse array implemented using a flat_hash_map from Abseil-cpp
  • C++20 in place of C++14,
  • Code style: camel case
  • Fixed CI for proper coverage release/debug and testing a single Python version

Removed

  • OpenMP and multithreading.
  • SSE, AVX and other intrinsics.

@pablolh pablolh force-pushed the release-0.6.0 branch 17 times, most recently from a50b696 to ac0dc92 Compare January 20, 2023 16:07
pablolh added 2 commits January 20, 2023 17:28
- Use a sparse array to store the global quantum state. This is
  implemented using a absl::flat_hash_map for performance.
- Remove all intrinsics instruction as well as all multithreading.
  The speedup obtained with the above
  is very good such that this is no longer needed (and would have to be
  reimplemented).
- More .cc files.
- Explicit matrices for all common quantum gates, this is way more
  readable.
- C++20 all the way.
- Camel case instead of snake case.

Consequences of this change:
- No more platform-specific things, thus this also support e.g. ARM.
- Performance is WAY BETTER even though it's using a single thread.
  Reason for this is likely the cache-friendliness of the code.
- C++20 allows the code to read better.
Almost a complete rewrite. No functional change except it's faster.

- Ability to easily implement any quantum gate by simply giving an arbitrary unitary matrix in Gates.h
- Performance speedup using a single thread
- Some proper linear algebra primitives using template metaprogramming
- Abseil-cpp dependency for flat_hash_map
- Ability to compile the simulator with an set maximum number of qubits - in the future this will
be using templates as well to switch data structures based on the input quantum circuit

- Quantum state is stored as a sparse array implemented using a flat_hash_map from Abseil-cpp
- C++20 in place of C++14,
- Code style: camel case

- OpenMP and multithreading.
- SSE, AVX and other intrinsics.
@pablolh
Copy link
Author

pablolh commented Jan 20, 2023

@oschusler this PR makes it possible to build and run on ARM

@oschusler
Copy link
Collaborator

I see you removed support for 3.7? Why exactly?

@pablolh
Copy link
Author

pablolh commented Jan 23, 2023

Morning Olaf,

Sorry for not mentioning it, I've been a bit messy with my commit.
I included a refactoring to the CI.

  • The tests workflow no longer tests all Python versions, only the latest one. On the other hand, more tests are included (C++ tests with different compilers and different build types Debug or Release). This has no effect on the released artifacts.
  • As you noticed, the Python 3.7 wheel is no longer published. I did this to reduce the load on the Github CI, since I believe that nobody uses 3.7, which has its official end-of-life in June this year. When I was pushing a lot of changes to Github, my workflows would not run immediately because of the load of building that many Python versions, so I had to cancel runs manually which was inconvenient. If QI or someone else depends on Python 3.7, I suggest upgrading to 3.8+ but if that is not possible I can add that version back.

Other things that I did not mention:

  • Error model is no longer implemented. That means this page no longer works. I realized that this might be a blocker, but error models would anyway need to be reimplemented with Add asymmetric depolarizing error model #107
  • The classical not gate operating on the measurement register described here is also no longer implemented. I can add it back shortly.

I suggest then we can merge this PR, then I create a separate PR when there is time for the error models and the classical not gate. Meanwhile QI doesn't have to upgrade. But that makes it possible to experiment with ARM64 it need be.

@pablolh pablolh marked this pull request as ready for review January 23, 2023 15:50
@pablolh pablolh merged commit de78fa5 into develop Jan 23, 2023
@pablolh pablolh deleted the release-0.6.0 branch January 23, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants