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

Feat pauli decomposition #123

Merged
merged 119 commits into from
Feb 18, 2025
Merged

Feat pauli decomposition #123

merged 119 commits into from
Feb 18, 2025

Conversation

MoHermes
Copy link
Collaborator

No description provided.

MoHermes and others added 30 commits January 27, 2025 11:11
…pqp into feat-pauli-decomposition

� Conflicts:
�	mpqp/tools/ptdr.py
…pqp into feat-pauli-decomposition

� Conflicts:
�	mpqp/tools/ptdr.py
…eat-pauli-decomposition

# Conflicts:
#	mpqp/tools/ptdr.py
…pqp into feat-pauli-decomposition

� Conflicts:
�	mpqp/tools/ptdr.py
self.nY = parent.nY + 1 if atom is Y else parent.nY

@property
def childI(self) -> "PauliNode":
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to store these as children ? to me instead of having a generic children list, when we can directly have the right children in the node ?

Copy link
Contributor

@hJaffaliColibritd hJaffaliColibritd Feb 18, 2025

Choose a reason for hiding this comment

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

You mean that we could define a method like this

def set_children(children: tuple[PauliNode, PauliNode, PauliNode, PauliNode]):
    self.childI = children[0]
    self.childX = children[1]
    self.childY = children[2]
    self.childZ = children[3]

And then remove the properties ?

This will avoid the usage of a list indeed, but then the treatments for each children will require the duplication of 4 lines ?

def test_pauli_to_matrix(
list_matrix_pauli_string: list[tuple[npt.NDArray[np.complex64], PauliString]],
):
for matrix, ps in list_matrix_pauli_string:
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, seeing the for loop, I realize that my advice wasn't such a good one, I should have experimented with it before telling you about it, we'll work on it after the coming release

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, maybe you can create a trello task, and resolve this comment afterwards

@Henri-ColibrITD
Copy link
Contributor

once we merge Julien's branch on this one, we can go ahead and merge this PR, there is still some work to do here but it can be done later on

@MoHermes MoHermes merged commit 8d17a29 into dev Feb 18, 2025
7 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.

4 participants