Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
expanded repr for UGate
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfLink committed Oct 2, 2022
1 parent b8842cd commit b82775e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions qsearch/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,7 @@ def assemble(self, v, i=0):
return [("gate", gatename, gateparams, indices)]

def __repr__(self):
if self.d == 2:
return "UGate({})".format(repr(U))
else:
return "UGate({}, d={})".format(repr(U), self.d)
return f"UGate({repr(self.U)}, {repr(self.d)}, {repr(self.gatename)}, {repr(self.gateparams)}, {repr(self.gateindices)})"

class UpgradedConstantGate(Gate):
"""Represents a constant gate, based on the Gate passed to its initializer, but upgraded to act on qudits of a larger size."""
Expand Down

0 comments on commit b82775e

Please sign in to comment.