def __init__(self, nbits, array): self.nbits = nbits self.size = np.size(array) self.basis = Qbasis(nbits) self.basis.setstd() ##standard basis used by default if np.size(array) > np.power(2, nbits): print "Error: Size mismatch - make sure that the size of the array matches with the size of the Hilbert space" else: self.array = array / aux.qregnorm(array)
def __init__(self,nbits,array): self.nbits = nbits self.size = np.size(array) if np.size(array) > np.power(2,nbits): print "Error: Size mismatch - make sure that the size of the array matches with the size of the Hilbert space" else: self.array = array/aux.qregnorm(array) self.regshape = array.shape self.array = np.reshape(self.array,(self.array.size,1))
def __init__(self,nbits,array): self.nbits = nbits self.size = np.size(array) self.basis = Qbasis(nbits) self.basis.setstd()##standard basis used by default if np.size(array) > np.power(2,nbits): print "Error: Size mismatch - make sure that the size of the array matches with the size of the Hilbert space" else: self.array = array/aux.qregnorm(array)
def __init__(self, nbits, array): self.nbits = nbits self.size = np.size(array) if np.size(array) > np.power(2, nbits): print "Error: Size mismatch - make sure that the size of the array matches with the size of the Hilbert space" else: self.array = array / aux.qregnorm(array) self.regshape = array.shape self.array = np.reshape(self.array, (self.array.size, 1))