-
Notifications
You must be signed in to change notification settings - Fork 9
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
Psgs integration #32
Psgs integration #32
Conversation
Signed-off-by: David Winderl <winderl13@gmail.com>
bfd601a
to
bdf8627
Compare
pauliopt/circuits.py
Outdated
inverted.add_gates(inv_gates) | ||
return inverted | ||
|
||
def apply_permutation(self, permutation: list): |
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.
list[int]
?
""" | ||
h_s_cx_decomposition = self.get_h_s_cx_decomposition() | ||
for gate in reversed(h_s_cx_decomposition): | ||
if gate.name == "H": |
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.
the logic of these 3 cases seem quite similar. Is it possible to combine it into one by having a mapping from gate.name to propagation dictionary?
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.
and a loop to update the Paulis?
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.
What exactly do you mean here loop over the qubits?
But of a CX a control is kind of dependent of the target pauli and vice versa.
4d1d97e
to
68d092b
Compare
Signed-off-by: David Winderl <winderl13@gmail.com> Removes append_pauli gadegt must me -> must be Change type to float constructor Signed-off-by: David Winderl <winderl13@gmail.com> Clifford clifford -> Clifford Tableau Signed-off-by: David Winderl <winderl13@gmail.com> Removes redundant if condition Signed-off-by: David Winderl <winderl13@gmail.com> Fix unit tests and pipeline Signed-off-by: David Winderl <winderl13@gmail.com> Fix tests Signed-off-by: David Winderl <winderl13@gmail.com>
68d092b
to
95ef167
Compare
Signed-off-by: David Winderl <winderl13@gmail.com>
pauliopt/pauli/pauli_polynomial.py
Outdated
return legs | ||
|
||
def assign_time(self, time: float): | ||
for gadet in self.pauli_gadgets: |
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.
gadget
pauliopt/pauli/pauli_polynomial.py
Outdated
else: | ||
pad_len = 0 | ||
return "\n".join( | ||
[self[i].to_string(pad_lenght=pad_len) for i in range(self.num_gadgets)] |
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.
pad_length
pauliopt/pauli/pauli_gadget.py
Outdated
def num_qubits(self): | ||
return len(self.paulis) | ||
|
||
def to_string(self, pad_lenght=0): |
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.
length!
) | ||
|
||
|
||
def sort_pauli_polynomial(pp: PauliPolynomial) -> PauliPolynomial: |
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.
Would the algorithm be faster if we used a different kind of sort?
Could we take advantage of the builtin python sort function here?
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.
Yes, but that would require a lot of refactoring since a also checks commutation and I am not confident of doing that now.
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.
Yes lets do this in the future instead :)
|
||
cols.sort(key=lambda x: len(x)) | ||
|
||
return cols_i, cols[-1][1:], cols[-1][0], cols[0][1:] + cols[1][1:] |
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.
Maybe cols should be a dictionary instead
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 argument as above, the point was to first integrate our algorithms
No description provided.