Skip to content

created solovay kitaev algorithm #133

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AshwinKaliyaperumal
Copy link

@AshwinKaliyaperumal AshwinKaliyaperumal commented Feb 13, 2025

Fixes #126

Summary of changes

created SV algorith implementation with temporary testing scaffolding at the bottom, doesn't work right now -> approx matrix is considerably off from target
created SV algorithm implementation with temporary testing scaffolding at the bottom, doesn't work right now -> approx matrix is considerably off from target
using updated code with proper testing scaffolding (prints out approx and target array)
best_dist = dist
best_gate = gate

return best_gate
Copy link
Member

@TheGupta2012 TheGupta2012 Feb 17, 2025

Choose a reason for hiding this comment

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

The approximating sequence length should not be 1 and is set by us. The user might have a requirement for more depth, but we will set this initially as <= 16. Ref - https://arxiv.org/pdf/quant-ph/0505030

image

...

image

I also believe @PranavTupe2000's code could be beneficial here, as discussed in our weekly meeting

for gate in w_sequence[1:]:
w_approx = w_approx * gate

result_sequence.extend([best_v, best_w, v_approx.dagger(), w_approx.dagger()])
Copy link
Member

Choose a reason for hiding this comment

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

I believe the result_sequence variable should also contain the $\mathbf{U}_{n-1}$ term (Ref: Page 5, Line 3). Is there a reason to omit that here because of the recursive function structure?


return result_sequence, final_error

def solovay_kitaev(target: np.ndarray, basic_gates: List[np.ndarray], depth: int = 3) -> List[np.ndarray]:
Copy link
Member

Choose a reason for hiding this comment

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

For a smoother interface, I believe basis_gates parameter should accept the BasisSet enum as a param and internally derive the basis gates from the BASIS_GATE_MAP

Copy link
Member

@TheGupta2012 TheGupta2012 left a comment

Choose a reason for hiding this comment

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

Hi @AshwinKaliyaperumal , thanks for working on this!

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.

Add Solovay Kitaev decomposition for Clifford + T
2 participants