nshots = 500; 
Npt = 7 # Número de passos de Trotter 
ph = 2*math.pi # ângulo para a transformação de simetria
t = math.pi
for j in range(0, Npt): # muda o No. de passos de Trotter
    # teórico
    U12 = UHxxx12_num(t/(j+1)); U23 = UHxxx23_num(t/(j+1))
    B = np.dot(U12, U23); U = np.linalg.matrix_power(B, j+1); psit = np.dot(U, psi0_)
    F_teo = qiskit.quantum_info.state_fidelity(psi0_, psit)
    # circuit q
    qc = QuantumCircuit(3)
    qc_psi0_ = qc_psi0(); qc.append(qc_psi0_, [0, 1, 2]) # estado inicial 
    qc_Bj_ = qc_Bj(t/(j+1))
    for k in range(0, j+1):
        qc.rz(ph/(j+1), [0, 1, 2]) # transformação de simetria
        qc.append(qc_Bj_, [0, 1, 2])
    qc.rz(-ph, [0, 1, 2]) # revertendo a transformação de simetria
    if j == 1:
        qc.draw(output = 'mpl')
    qstc = state_tomography_circuits(qc, [0, 1, 2])
    # simulação
    job = qiskit.execute(qstc, backend = simulator, shots = nshots)
    qstf = StateTomographyFitter(job.result(), qstc)
    rho = qstf.fit(method = 'lstsq')
    F_sim = qiskit.quantum_info.state_fidelity(psi0__, rho)
    # experimento
    jobE = qiskit.execute(qstc, backend = device, shots = nshots)
    print(jobE.job_id()); job_monitor(jobE)
    qstfE = StateTomographyFitter(jobE.result(), qstc)
    rhoE = qstfE.fit(method = 'lstsq')
    F_exp = qiskit.quantum_info.state_fidelity(psi0__, rhoE)
    print('No. passos=', j+1, ',F_teo=', F_teo, ',F_sim=', F_sim, ',F_exp=', F_exp)

qc.draw(output = 'mpl')