fix migration guide
"from qiskit.algorithms import HamiltonianPhaseEstimation\n",
"from qiskit.opflow import I, X, Y, Z, StateFn, PauliTrotterEvolution, Suzuki\n",
"\n",
- "state_preparation = StateFn(state_in)\n",
+ "n_ancillae = 5\n",
+ "num_time_slices = 1\n",
"\n",
"op = 0.5 * X + Y + Z\n",
"\n",
- "evolution = PauliTrotterEvolution()\n",
+ "state_preparation = StateFn(state_in)\n",
+ "\n",
+ "evolution = PauliTrotterEvolution('trotter', reps=num_time_slices)\n",
"\n",
- "qpe = HamiltonianPhaseEstimation(5, quantum_instance=qinstance)\n",
- "result = qpe.estimate(op, state_preparation)\n",
+ "qpe = HamiltonianPhaseEstimation(n_ancillae, quantum_instance=qinstance)\n",
+ "result = qpe.estimate(op, state_preparation, evolution=evolution)\n",
"\n",
"print(result.most_likely_eigenvalue)"
]
