Skip to content

Comments

Refactor phase gradient bloq dtypes#1191

Merged
anurudhp merged 7 commits intoquantumlib:mainfrom
anurudhp:2024/07/24-refactor-phase-gradient
Jul 26, 2024
Merged

Refactor phase gradient bloq dtypes#1191
anurudhp merged 7 commits intoquantumlib:mainfrom
anurudhp:2024/07/24-refactor-phase-gradient

Conversation

@anurudhp
Copy link
Contributor

splitting #1142, part 1.

  • add dtype properties to all bloqs and use them in signatures
  • split unit tests into smaller components

@anurudhp anurudhp requested a review from tanujkhattar July 25, 2024 02:50
Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

this lgtm. the library changes seem minimal and the test changes -- splitting into more specific unit tests is always appreciated

@pytest.mark.parametrize(
'bloq',
[
pytest.param(bloq, marks=pytest.mark.slow if bloq.num_qubits() > 12 else ())
Copy link
Collaborator

Choose a reason for hiding this comment

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

bloq2 is still getting executed on my machine (7 seconds) despite it looking like it should be 4+9=13 qubits

Copy link
Collaborator

Choose a reason for hiding this comment

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

consider using bloq.signature.n_qubits, which is explicit about how it handles left/right registers

Copy link
Contributor Author

@anurudhp anurudhp Jul 26, 2024

Choose a reason for hiding this comment

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

About bloq2, my guess would be that because AddIntoPhaseGrad doesn't define a decomposition, but only a classical action, and cirq.unitary is much faster for classical gates.

@anurudhp anurudhp enabled auto-merge (squash) July 26, 2024 22:29
@anurudhp anurudhp merged commit 16b5378 into quantumlib:main Jul 26, 2024
@anurudhp anurudhp deleted the 2024/07/24-refactor-phase-gradient branch July 26, 2024 22:47
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