Is there a way to create a PauliString that will target a specific amplitude state? I know you can use qp.PauliZ(0) @ qp.PauliZ(1) to target two qubit, but wondering if there’s anything we can do at the binary amplitude state level. This would be for setting a cost hamiltonian for QAOA where I want to penalize a specific state.
If I understand your question correctly, then the answer should be yes. The projector onto a specific bitstring is diagonal, so it is a sum of Pauli-Zs and identities:
Using qp.Projector won’t work in qp.qaoa.cost_layer. So, you can try to create a method that returns the relevant penalty and add that to the problem Hamiltonian. Try it out, and thanks again for your question! I’d be curious to hear what happens.