7 self.pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
8 self.sub = rospy.Subscriber('scan', LaserScan, self.callback)
9
10 def callback(self, msg):11 twist = Twist()
12 twist.linear.x = 0.5
13 twist.angular.z = 0.5
54 return QGate(3, matrix)
55
56 @staticmethod
57 def fredkin(control, target1, target2):58 matrix = np.eye(2**3, dtype=complex)
59 matrix[4, 4] = 0
60 matrix[4, 5] = 1
54 return QGate(3, matrix)
55
56 @staticmethod
57 def fredkin(control, target1, target2):58 matrix = np.eye(2**3, dtype=complex)
59 matrix[4, 4] = 0
60 matrix[4, 5] = 1
54 return QGate(3, matrix)
55
56 @staticmethod
57 def fredkin(control, target1, target2):58 matrix = np.eye(2**3, dtype=complex)
59 matrix[4, 4] = 0
60 matrix[4, 5] = 1
45 return QGate(2, matrix)
46
47 @staticmethod
48 def toffoli(control1, control2, target):49 matrix = np.eye(2**3, dtype=complex)
50 matrix[6, 6] = 0
51 matrix[6, 7] = 1
An unused argument can lead to confusions. It should be removed. If this variable is necessary, name the variable _
or start the name with unused
or _unused
.
def square(x, y=1):
return x * x
class MySubClass(MyClass):
def __init__(self, number):
self.value = 42 # argument `number` remains unused
def square(x):
return x * x
class MySubClass(MyClass):
def __init__(self, _):
self.value = 42