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

Psgs integration #32

Merged
merged 16 commits into from
Sep 22, 2024
Merged

Psgs integration #32

merged 16 commits into from
Sep 22, 2024

Conversation

daehiff
Copy link
Collaborator

@daehiff daehiff commented Jul 28, 2024

No description provided.

@daehiff daehiff force-pushed the PSGS_integration branch from bfd601a to bdf8627 Compare July 28, 2024 23:17
pauliopt/clifford/tableau.py Outdated Show resolved Hide resolved
inverted.add_gates(inv_gates)
return inverted

def apply_permutation(self, permutation: list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

list[int]?

pauliopt/gates.py Outdated Show resolved Hide resolved
pauliopt/gates.py Outdated Show resolved Hide resolved
"""
h_s_cx_decomposition = self.get_h_s_cx_decomposition()
for gate in reversed(h_s_cx_decomposition):
if gate.name == "H":
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

pauliopt/gates.py Outdated Show resolved Hide resolved
pauliopt/pauli/pauli_gadget.py Outdated Show resolved Hide resolved
pauliopt/pauli/pauli_polynomial.py Outdated Show resolved Hide resolved
pauliopt/pauli/pauli_polynomial.py Outdated Show resolved Hide resolved
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>
daehiff and others added 2 commits August 11, 2024 15:46
Signed-off-by: David Winderl <winderl13@gmail.com>
y-richie-y
y-richie-y previously approved these changes Sep 9, 2024
return legs

def assign_time(self, time: float):
for gadet in self.pauli_gadgets:
Copy link
Collaborator

Choose a reason for hiding this comment

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

gadget

else:
pad_len = 0
return "\n".join(
[self[i].to_string(pad_lenght=pad_len) for i in range(self.num_gadgets)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

pad_length

def num_qubits(self):
return len(self.paulis)

def to_string(self, pad_lenght=0):
Copy link
Collaborator

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:
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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:]
Copy link
Collaborator

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

Copy link
Collaborator Author

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

@y-richie-y y-richie-y merged commit 3fff2d9 into hashberg-io:main Sep 22, 2024
3 checks passed
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.

2 participants