1
$\begingroup$

I'm trying to evolve a 3 qubit system under a Pauli Sum Hamiltonian in QISKIT using the TrotterQRTE method, and observe the projection of on the singlet state at every time step. How do I program the singlet projector properly in 'aux_operators'?

def TimeEvolve(theta, A=A_vedral, gamma=5.):
     hamiltonian = PauliSumHamiltonian(theta,A)
     qr_pair = QuantumRegister(2, name="e")
     qr_mol = QuantumRegister(1, name="z")
     qc_initial = QuantumCircuit(qr_pair, qr_mol)
     qc_initial.x(0)
     qc_initial.x(1)
     qc_initial.h(1)
     qc_initial.cnot(1, 0)


     projector = tensor(singlet_state().proj(), qeye(2)).unit().data.toarray()

     time = gamma
     evolution_problem = EvolutionProblem(hamiltonian, time, qc_initial, aux_operators=projector)

     product_formula = LieTrotter(reps = 2)
     backend = AerSimulator(method='density_matrix')#,noise_model=noise_model)
     quantum_instance = QuantumInstance(backend=backend)
     expectation = AerPauliExpectation()#.convert(measurable_expression)
     trotter_qrte = TrotterQRTE(product_formula = product_formula, expectation=expectation, quantum_instance=quantum_instance)
     evolved_state = trotter_qrte.evolve(evolution_problem).evolved_state
     return evolved_state

I usually get the error "QiskitError: 'Sum of amplitudes-squared does not equal one.'". I'm only interested in measuring the first two qubits.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.