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

Support of equality in Circuit and Lattice classes #140

Closed
4 of 6 tasks
isolatedinformation opened this issue Nov 8, 2021 · 6 comments
Closed
4 of 6 tasks

Support of equality in Circuit and Lattice classes #140

isolatedinformation opened this issue Nov 8, 2021 · 6 comments
Assignees

Comments

@isolatedinformation
Copy link
Contributor

isolatedinformation commented Nov 8, 2021

Writing tests involves assert statements. Right now, if we compare two objects for equality, it returns False. By default, Python object identifiers for comparison operations. The classes that need to support equality are:

in lsqeccc/pauli_rotations:

  • circuit.PauliOpRotation
  • rotation.PauliProductOperation
  • rotation.PauliRotation
  • rotation.Measurement

in lsqecc/logical_lattice_ops:

  • llops.LogicalLatticeOperation and associated child classes
  • llops.LogicalLatticeComputation

This thread has insights on implementing equality features.

@alexnguyenn
Copy link
Member

I will handle pauli_rotations/ stuffs but @gwwatkin can you look at logical_latice_ops/?

@gwwatkin
Copy link
Member

gwwatkin commented Nov 9, 2021

@alexnguyenn I can of course, but my understanding was that @isolatedinformation was going to handle this

@alexnguyenn
Copy link
Member

Added equalities for PauliRotation and Measurement. There is no need for PauliOperator (being an Enum) and PauliProductOperation (being an Abstract Base Class - although I will need to rewrite that class a little bit)

@gwwatkin gwwatkin mentioned this issue Nov 12, 2021
12 tasks
@gwwatkin
Copy link
Member

@isolatedinformation is writing tests he'll decide if llops still need equality

@isolatedinformation
Copy link
Contributor Author

  1. Llops does not need equality. Because we have already verified in Circuit if the ops are equal. Since equality is already implement for Circuit and Rotation classes, and llops attributes are composed of objects from these any assertion that needs to be made can exploit these inbuilt equalities.
  2. I don't see the end-user working with the internal details of llops, except for instantiating a LogicalLatticeComputation object. Everything else is internal and a good chunk of llops tests have already been written without need for equality.

@gwwatkin
Copy link
Member

Sounds good, @isolatedinformation. I agree

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

No branches or pull requests

3 participants