def plot_state(rho, method='city'):
"""Plot the quantum state."""
num = int(np.log2(len(rho)))
# Need updating to check its a matrix
if method == 'city':
plot_state_city(rho)
elif method == "paulivec":
plot_state_paulivec(rho)
elif method == "qsphere":
plot_state_qsphere(rho)
elif method == "bloch":
for i in range(num):
bloch_state = list(map(lambda x: np.real(np.trace(
np.dot(x.to_matrix(), rho))),
pauli_singles(i, num)))
plot_bloch_vector(bloch_state, "qubit " + str(i))
elif method == "wigner":
plot_wigner_function(rho)
###############################################################
# Plotting Wigner functions
###############################################################
评论列表
文章目录