I wonder how I can plug in my own customized wavefunction form while using VQE
in qiskit. Thanks in advance!
I wonder how I can plug in my own customized wavefunction form while using VQE
in qiskit. Thanks in advance!
You can parameterized your QuantumCircuit
before plugging it into VQE
. For example
from qiskit.algorithms import VQE
from qiskit.circuit.library import EfficientSU2
# the rotation gates are chosen randomly, so we set a seed for reproducibility
num_qubits = 4
ansatz = EfficientSU2(num_qubits, reps=1, entanglement='linear', insert_barriers=True)
vqe = VQE(ansatz=ansatz, ... )
You can see a full example here: qiskit.org/documentation/partners/qiskit_runtime/tutorials/vqe.html