# How to get resultant statevector after applying parameterized gates in qiskit?

I want to check the expressibility of my ansatz and calculate the resultant statevector on paper seems difficult. Is there a way I can do this in qiskit? I have the circuit for the ansatz which has parameterized controlled $$Y$$-axis rotations. Is there a way I can get the resultant statevector in terms of my parameters $$\theta$$?

I am also working with efficient $$SU(2)$$ ansatz. Is there any resource on this? Anything that covers the expressibility and efficiency of this kind of ansatz?

Is there a way I can get the resultant statevector in temrs of my parameter $$\theta$$s?

I don't think Qiskit itself has this functionality. May be this is because symbolic expressions become nasty very quickly when circuit size increases.

There is, however, a package developed by @SimoneGasperini named qiskit-symb which can be used to achieve this.

To demonstrate how to use this package, let's create a sample parameterized circuit:

from qiskit.circuit.library import ZZFeatureMap
circ = ZZFeatureMap(feature_dimension=4, reps=1)
circ = circ.decompose()


We get the Statevector as follows:

from qiskit_symb.quantum_info import Statevector
state_vec = Statevector(circ)
state_vec.to_sympy()


And to assign the parameters:

sv_func = state_vec.to_lambda()

params = [0.12, 0.34, 0.56, 0.78]
psi = sv_func(*params)

psi

• It's a shame that it's not doable in plain Qiskit. Do you know if there's been a discussion about it on Qiskit's GitHub? Otherwise, it would be worth a try to submit the idea there Jul 24, 2023 at 7:43
• Jul 24, 2023 at 8:18
• Thanks! I'll try using this package and update here later Jul 24, 2023 at 9:52
• @CheshtaJoshi feel free to contact me if you need any support to use my qiskit-symb package Jul 24, 2023 at 13:35
• This is amazing @SimoneGasperini . It works perfectly well! Jul 24, 2023 at 14:24