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

[Feature] Projector blocks #208

Merged
merged 31 commits into from
Nov 27, 2023
Merged

[Feature] Projector blocks #208

merged 31 commits into from
Nov 27, 2023

Conversation

RolandMacDoland
Copy link
Collaborator

@RolandMacDoland RolandMacDoland commented Nov 21, 2023

Closes #193.

Few points to consider:

  • Preconditions checks: bra,ket and support must be of the same length.
  • qubit_support as a positional argument.
  • Projector should be block_to_tensorable.
  • Express N as a projector
  • Integrate N in controlled blocks, i.e. Toffoli.
  • Integration with PyQ

@RolandMacDoland RolandMacDoland added the feature New feature or request label Nov 21, 2023
@RolandMacDoland RolandMacDoland self-assigned this Nov 21, 2023
Copy link
Collaborator

@jpmoutinho jpmoutinho left a comment

Choose a reason for hiding this comment

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

Thanks @Roland-djee! Looks good so far, not much to say :)

qadence/blocks/primitive.py Outdated Show resolved Hide resolved
qadence/operations.py Outdated Show resolved Hide resolved
qadence/blocks/primitive.py Show resolved Hide resolved
qadence/operations.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jpmoutinho jpmoutinho left a comment

Choose a reason for hiding this comment

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

Thanks @Roland-djee. One thing to note is that @vytautas-a mentioned he had some issues with GPSR in his addressing pattern MR due to N not having a defined generator and generator_eigenvalues, whereas (I-Z)/2 was fine because each of those separately do have them. Maybe @vytautas-a you can take a look here to see if you think any of these changes might lead to more of those issues?

qadence/blocks/primitive.py Show resolved Hide resolved
qadence/operations.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@madagra madagra left a comment

Choose a reason for hiding this comment

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

A few comments but looks overall good to me.

qadence/blocks/primitive.py Show resolved Hide resolved
qadence/circuit.py Outdated Show resolved Hide resolved
qadence/operations.py Show resolved Hide resolved
qadence/states.py Outdated Show resolved Hide resolved
tests/qadence/test_operators.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@madagra madagra left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just check it does not generate issues with GPSR as mentioned.

@dominikandreasseitz
Copy link
Collaborator

i guess this MR is dependent on pasqal-io/pyqtorch#131 @Roland-djee, should we wrap up that one first

@RolandMacDoland
Copy link
Collaborator Author

i guess this MR is dependent on pasqal-io/pyqtorch#131 @Roland-djee, should we wrap up that one first

Indeed. I was waiting for the PyQ one to be merged and a new release before moving forward this one.

Copy link
Collaborator

@dominikandreasseitz dominikandreasseitz left a comment

Choose a reason for hiding this comment

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

lgtm thanks, lets merge

@RolandMacDoland RolandMacDoland merged commit beae601 into main Nov 27, 2023
8 checks passed
@RolandMacDoland RolandMacDoland deleted the rg/projector-blocks branch November 27, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a general Projector(PrimitiveBlock) i.e. |1><1|
4 participants