I'm fairly new to the Qiskit API. I was wondering if I could get some assistance with trying to implement our technique of projecting out a new Hamiltonian from the ground-state Hamiltonian. The technique is discussed in our preprint.

There are two main challenges that I'm confronted with:

  1. The qiskit constructed Hamiltonian by default consist of only the non-zero Pauli strings. How can this be changed to allow for adding and removing terms that may be initial zero.
  2. How and where would one dynamically modify each Pauli coefficient in the Hamiltonian? For example it appears something like qubitop.aer_pauli[i,:] = 1.0 + 0.0j should work, but I'm not sure this is complete or an appropriate approach.

This would enable us to then use the VQE routines with Qiskit to further verify this method.

I'm looking to make these modification to the Qiskit source code just need some guidance.


1 Answer 1

  1. The FermionicOperator, when its mapped to a Qubit Operator, indeed drops paulis that are below a given threshold. If you wanted to keep all the paulis, regardless of their weights then you could alter your local copy to comment the thresholding out in the one and two body mapping routines. As far as I am aware a weighted paulis list given to WeightedPauliOperator will be kept in its entirety. It has methods to simplify and chop but unless these are called the pauli list should be preserved.

  2. The operator contains a list of paulis which you can retrieve. You could copy that and create a new operator with a modified list. I am not sure how dynamic you need this to be. VQE will build parameterized circuits which depend on the number of paulis (or pauli groups if using TensorProductBasis (TPB) operator). Adding or removing while VQE is running (were you to modify internals of VQE to add/remove dynamically would cause problems unless the parameterized circuit cache it holds was removed and rebuilt as needed). Given you keep the number of paulis the same you should be able to alter their weights within the given operator.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.