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

PR for Issue #134 Unitary Hack #138

Merged

Conversation

bopardikarsoham
Copy link
Contributor

@bopardikarsoham bopardikarsoham commented May 27, 2023

Hello, @Hanrui-Wang. I added a sample PR to the codebase by adding the SDG gate. I intend to add more, but first I'd like you to check if I did everything right. As described in Issue #134, I put the sdg matrix to the matrix dictionary in functional.py and wrote a function for the gate. Next, I added the sdg class to the operators.py file, and finally, I added the sdg gate to the test_op.py file.

@@ -1168,6 +1169,9 @@ def singleexcitation_matrix(params):
),
"ecr": torch.tensor(
[[0, 0, 1, 1j], [0, 0, 1j, 1], [1, -1j, 0, 0], [-1j, 1, 0, 0]], dtype=C_DTYPE
),
"sdg": torch.tensor(
[[1 + 0j, 0 + 0j],[0 + 0j, -0 - 1j]], dtype=C_DTYPE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you change this to [[1, 0], [0, -1j]] for better readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

inverse: bool = False,
comp_method: str = "bmm",
):
"""Perform the hadamard gate.
Copy link
Collaborator

Choose a reason for hiding this comment

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

here should be the sdg gate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sorry

@bopardikarsoham
Copy link
Contributor Author

bopardikarsoham commented May 28, 2023

I've made the necessary modifications @Hanrui-Wang ; does the current PR appear to be satisfactory? Should I keep adding gates in this format? Could you also please assign me Issue #134?

@bopardikarsoham
Copy link
Contributor Author

Hello @Hanrui-Wang, I have added 3 more gates TDG, SXDG and CH.

@Hanrui-Wang
Copy link
Collaborator

Hi Soham, the added gates looks good, thank you for your contributions! could you pull request to the dev branch?

@bopardikarsoham
Copy link
Contributor Author

Sure @Hanrui-Wang , I'll PR to the dev branch

@bopardikarsoham bopardikarsoham changed the base branch from main to dev May 30, 2023 11:24
@bopardikarsoham
Copy link
Contributor Author

I changed the base branch to dev, but I think some of the previous commits from the repo also got added to my PR

@bopardikarsoham bopardikarsoham changed the title Sample PR for SDG gate Issue #134 Unitary Hack PR for Issue #134 Unitary Hack May 30, 2023
@bopardikarsoham
Copy link
Contributor Author

bopardikarsoham commented Jun 1, 2023

Hi @Hanrui-Wang just updating you regarding my progress,

Non-Parameterized Gates:

  • SDG
  • TDG
  • SXDG
  • CH
  • CCZ
  • iSWAP
  • CS
  • CSDG
  • CSX

Parameterized Gates:

  • R

I believe I have covered the majority of the missing gates, but I'll continue to look for additional ones.

Further Work:

Adding more ansatz layers(EfficientSU2, RealAmplitudes, etc.) and NLocal circuits.

@bopardikarsoham bopardikarsoham changed the base branch from dev to unitary_hack June 12, 2023 09:38
@Hanrui-Wang Hanrui-Wang merged commit 5eb2cb8 into mit-han-lab:unitary_hack Jun 13, 2023
0 of 2 checks passed
@Hanrui-Wang
Copy link
Collaborator

Thank you @bopardikarsoham for your contributions!

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.

None yet

2 participants