def to_matrix(self):
    'Return a numpy.array for the RX gate.'
    cos = math.cos((self.params[0] / 2))
    sin = math.sin((self.params[0] / 2))
    return numpy.array([[cos, ((- 1j) * sin)], [((- 1j) * sin), cos]], dtype=complex)
Return a numpy.array for the RX gate.
def to_matrix(self):
    
    cos = math.cos((self.params[0] / 2))
    sin = math.sin((self.params[0] / 2))
    return numpy.array([[cos, ((- 1j) * sin)], [((- 1j) * sin), cos]], dtype=complex)