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

lcu implementation #178

Merged
merged 8 commits into from
Aug 2, 2022
Merged

Conversation

JamesB-1qbit
Copy link
Contributor

This implements the Linear Combination of Unitaries algorithm.
Both the standard form for any operator and the truncated taylor series form are included.

@JamesB-1qbit JamesB-1qbit marked this pull request as ready for review July 25, 2022 15:28
Copy link
Collaborator

@alexfleury-sb alexfleury-sb left a comment

Choose a reason for hiding this comment

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

I am good with the most of it. Here are some general questions:

  • Could get_truncated_taylor_series be in a different file as it seems different vs the LCU?
  • Is there any justification for the use of vec = (vecs[:, 0] + vecs[:, 1])/np.sqrt(2) as the initial state in the tests?

tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Show resolved Hide resolved
Copy link
Collaborator

@ValentinS4t1qbit ValentinS4t1qbit 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 things. Good work, you make solid use of the tangelo objects and numpy, your documentation and flow looks great as well.

tangelo/toolboxes/circuits/lcu.py Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/lcu.py Show resolved Hide resolved
tangelo/toolboxes/circuits/tests/test_lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/tests/test_lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/tests/test_lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/tests/test_lcu.py Outdated Show resolved Hide resolved
tangelo/toolboxes/circuits/tests/test_lcu.py Outdated Show resolved Hide resolved
@JamesB-1qbit
Copy link
Contributor Author

I am good with the most of it. Here are some general questions:

  • Could get_truncated_taylor_series be in a different file as it seems different vs the LCU?
  • Is there any justification for the use of vec = (vecs[:, 0] + vecs[:, 1])/np.sqrt(2) as the initial state in the tests?
  • They are both LCU based algorithms. They just use a different encoding for the ancilla qubits.
  • No, just something that is not an eigenvector of the Hamiltonian.

Copy link
Collaborator

@ValentinS4t1qbit ValentinS4t1qbit left a comment

Choose a reason for hiding this comment

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

Good stuff !

@ValentinS4t1qbit ValentinS4t1qbit merged commit 5df2533 into sandbox-quantum:develop Aug 2, 2022
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.

3 participants