I want to input my own initial state to Grover’s algorithm in qiskit, i.e. using the amplitude amplifier algorithm. The input state is a subset of superposed states instead of the default maximally entangled state. I know how to write the input state in a stateVector
form, but Grover
in qiskit seems to only accept quantum circuit as input for the initial state in state_preparation
. It is much more difficult for me to design the quantum circuit knowing the statevector. Any suggestions?
As an example, here is the state I want to use as the input state for the Grover’s algorithm:
$|0001\rangle + |0101\rangle + |0111\rangle + |1010\rangle$