I am trying to evolve a quantum state through a
PauliTrotterEvolution in aqua and I'm trying to do so by initializing a random state, by using
op=get_hamiltonian(-1,h) # a 4 qubit operator evo_op=(t*op).exp_i() evo_op=evo_op trotter_op=PauliTrotterEvolution(trotter_mode=Suzuki(reps=10,order=1)).convert(evo_op) qinstance=QuantumInstance(backend=Aer.get_backend("qasm_simulator"), shots=2048) sampler=CircuitSampler(qinstance) trotter_op=trotter_op @ StateFn(state) results1=sampler.convert(trotter_op).primitive
this returns the following error:
ValueError: Qiskit circuit Initializer cannot handle non-positive statevectors. however, by the source code, the
Initializer comes from
qiskit.extensions which I believe is from this .py file (file) whose docstring states:
"""Complex amplitude initialization. Class that implements the (complex amplitude) initialization of some flexible collection of qubit registers (assuming the qubits are in the zero state). Note that Initialize is an Instruction and not a Gate since it contains a reset instruction, which is not unitary. """
what am I missing?