-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adds two qubit functions #70
Conversation
|
The two functions are very general and can be promoted as class method, rather than being restricted in the decomposition module.
Co-authored-by: Boxi Li <etamin1201@gmail.com>
return(user_gates, gate_list) | ||
|
||
|
||
def decompose_two_qubit_to_CNOT_and_single_qubit_gates(input_gate): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output of this function is not what it is expected to be. For this reason, all of the smaller gates for U6,...,U1 have been defined separately. A for loop will be created for this once the output matches exactly to the input. In addition, all the two qubit decomposition methods will be made private after a general two qubit decomposition function isalso be added - provides choice for circuit output.
Need to recalculate the target and control qubits because they were different from what was expected for the two level circuit output function. The output of the two level output matches exactly to the input with new values for controls and targets.
Just because I know the correct control and targets does not imply how the controls and targets for CNOT and Pauli X of each gate should be corrected.
The hope is to check and compare my calculations with the targets and controls from gray code function's output.
Tentative new values for the target/controls - cnot_gates_2_qubits.pdf
) | ||
|
||
|
||
def _decompose_to_two_level_arrays(input_gate): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function will be discarded after a general function decomposing a n qubit gate to two level arrays is defined.
The plan is to iterate over the row and column indices in a for loop to avoid manually defining indices for the decomposition.
return(array_list) | ||
|
||
|
||
def decompose_two_qubit_to_two_level_unitary(input_gate): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Once a general method for decomposition to two level unitaries exists, this function will be discarded.
Defined here for convenience of checking the output of a two qubit gate.
Closing this for now because git rebase is causing issues with conflicts. Will open a new PR. |
Circuit of Two-Level Unitaries Example
The output of the function is a tuple of the gate dictionary and two-level gates in order. The gate labels are arbitrary numbered U's which will hopefully change when a two-level unitary gate is added.