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

Move state reshape in gates #340

Merged
merged 7 commits into from
Mar 5, 2021
Merged

Move state reshape in gates #340

merged 7 commits into from
Mar 5, 2021

Conversation

stavros11
Copy link
Member

Moves the state reshape required for non-custom backends inside the gates instead of the circuit. This fixes some compatibility issues between gates of different backends and makes testing easier.

It also fixes #337 since the tensor_shape and flat_shape attributes are no longer required during circuit creation. For this point I also added a test that initializes a QFT for n=100 qubits and checks that the depth is 2n and the number of gates n^2/2 + n.

@stavros11 stavros11 requested a review from scarrazza March 5, 2021 11:26
@codecov
Copy link

codecov bot commented Mar 5, 2021

Codecov Report

Merging #340 (27cdec4) into master (8502ee6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #340   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           74        74           
  Lines        12092     12082   -10     
=========================================
- Hits         12092     12082   -10     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qibo/core/circuit.py 100.00% <ø> (ø)
src/qibo/tests_new/test_core_gates.py 100.00% <ø> (ø)
src/qibo/core/gates.py 100.00% <100.00%> (ø)
src/qibo/tests/test_density_matrix.py 100.00% <100.00%> (ø)
src/qibo/tests/test_qft.py 100.00% <100.00%> (ø)
src/qibo/tests_new/test_core_circuit_features.py 100.00% <100.00%> (ø)
...c/qibo/tests_new/test_core_gates_density_matrix.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8502ee6...27cdec4. Read the comment docs.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stavros11 thanks for this implementation and fix, looks good!

@scarrazza scarrazza merged commit 48dee5f into master Mar 5, 2021
@scarrazza scarrazza deleted the gatereshape branch March 6, 2021 09:26
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.

Cannot allocate circuits with large nqubits
2 participants