示例#1
0
文件: gates.py 项目: mlazzarin/qibo
 def _density_matrix_call(self, state):
     if K.op is not None:
         shape = state.shape
         state = K.reshape(state, (K.np.prod(shape), ))
         original_targets = tuple(self.target_qubits)
         self._target_qubits = self.cache.target_qubits_dm
         self._nqubits *= 2
         state = K.state_vector_matrix_call(self, state)
         self._nqubits //= 2
         self._target_qubits = original_targets
         return K.reshape(state, shape)
     return K._state_vector_call(self, state)
示例#2
0
文件: gates.py 项目: mlazzarin/qibo
 def _state_vector_call(self, state):
     return K._state_vector_call(self, state)