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

Implement two qubit unitary to operations algorithm from https://arxiv.org/abs/quant-ph/0406176 #6777

Open
NoureldinYosri opened this issue Oct 17, 2024 · 4 comments
Labels
good for learning For beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues" kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on

Comments

@NoureldinYosri
Copy link
Collaborator

The paper https://arxiv.org/abs/quant-ph/0406176 introduces an algorithm for performing quantum shannon decomposition. We have this algorithm implemented in Cirq in

However, one of the base cases of the algorithms is not implemented. Namely A.2 the base case for a two qubit unitary, instead cirq uses another decomposition

if n == 4:
operations = tuple(
two_qubit_matrix_to_cz_operations(
qubits[0], qubits[1], u, allow_partial_czs=True, clean_operations=True, atol=atol
)
)
yield from operations
i, j = np.unravel_index(np.argmax(np.abs(u)), u.shape)
new_unitary = unitary_protocol.unitary(FrozenCircuit.from_moments(*operations))
global_phase = np.angle(u[i, j]) - np.angle(new_unitary[i, j])
if np.abs(global_phase) > 1e-9:
yield ops.global_phase_operation(np.exp(1j * global_phase))
return

Which is not as efficient as the decompositin described in A.2. It would be nice to implement A.2 and uses it in QSD.

What is the urgency from your perspective for this issue? Is it blocking important work?

P2 - we should do it in the next couple of quarters

@NoureldinYosri NoureldinYosri added kind/feature-request Describes new functionality good for learning For beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues" triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Oct 17, 2024
@RahilJain1366
Copy link

Hi @NoureldinYosri, can I take this up too since I am trying to find a solution for #6770?

@senecameeks senecameeks added triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Oct 30, 2024
@senecameeks
Copy link
Collaborator

Cirq Cynq: This will improve the performance by reducing the number of rotations and depth of the circuit.

@senecameeks
Copy link
Collaborator

@RahilJain1366, thanks for offering, let's discuss after #6770 is complete

@ldi18
Copy link

ldi18 commented Nov 10, 2024

Hi, I’m also interested in working on this if @RahilJain1366 hasn’t taken it up yet @senecameeks .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good for learning For beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues" kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on
Projects
None yet
Development

No branches or pull requests

4 participants