diff --git a/paddle_quantum/utils.py b/paddle_quantum/utils.py index 81d476720907e527b018e6869aa487c41ea1cd7b..26c289ec651e8e8bcd8a42a5461fc8d566a6d54a 100644 --- a/paddle_quantum/utils.py +++ b/paddle_quantum/utils.py @@ -1310,17 +1310,7 @@ def plot_n_qubit_state_in_bloch_sphere( for i in range(state_len): assert type(state[i]) == paddle.Tensor or type(state[i]) == np.ndarray, \ 'the type of "state[i]" should be "paddle.Tensor" or "numpy.ndarray".' - - # Convert Tensor to numpy - for i in range(state_len): - if type(state[i]) == paddle.Tensor: - state[i] = state[i].numpy() - # Convert state_vector to density_matrix - for i in range(state_len): - if state[i].size == 2: - state_vector = state[i] - state[i] = np.outer(state_vector, np.conj(state_vector)) if show_qubits is None: show_qubits = [None]*state_len else: