コード例 #1
0
    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)
コード例 #2
0
ファイル: qregister.py プロジェクト: qubitnerd/Quacpy
	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))
コード例 #3
0
ファイル: qregister.py プロジェクト: qubitnerd/Quacpy
	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)
コード例 #4
0
    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))