# Keep receiving Error - AttributeError: 'QuantumCircuit' object has no attribute 'save_statevector'

I am attempting to code a feed-forward simulation of a QECC in Qiskit. Qiskit (to my knowledge) does not directly support feed-forward simulation, so I attempted a work-around. I call the simulator firstly:

    #c/q register
self.qubits = QuantumRegister(9)
self.round1 = ClassicalRegister(2)
self.round2 = ClassicalRegister(3)
self.decoded = ClassicalRegister(7)
self.circuit = QuantumCircuit(self.qubits,self.round1,self.round2,self.decoded,name="circuit")

#noise model
self.noisy = NoiseModel()
self.error_rate = self.error_rates
self.error_two_qubit = errors.depolarizing_error(self.error_rate/15, 2)

#simulator backend
self.simulator = Aer.get_backend('qasm_simulator',noise_model=self.noisy)


Next, I attempt to save the statevector after calling the first stabilizer operator:

    self.circuit.reset(self.qubits[7])
self.circuit.reset(self.qubits[8])
self.circuit.h(self.qubits[8])
self.circuit.cx(self.qubits[8],self.qubits[7])
self.circuit.cx(self.qubits[target1],self.qubits[7])
self.circuit.cx(self.qubits[target2],self.qubits[8])
self.circuit.cx(self.qubits[target3],self.qubits[7])
self.circuit.cx(self.qubits[target4],self.qubits[8])
self.circuit.cx(self.qubits[8],self.qubits[7])
self.circuit.h(self.qubits[8])
self.circuit.measure(self.qubits[7],self.round1[0])
self.circuit.measure(self.qubits[8],self.round1[1])
self.circuit.save_statevector()


I lastly then attempt to execute the code up to the save-point:

self.result = execute(self.circuit,self.simulator,shots=1).result()
self.statevector = self.result.get_statevector(self.circuit)


I am not entirely sure why the error I get is of the following form:

Traceback (most recent call last):
self.circuit.save_statevector()
AttributeError: 'QuantumCircuit' object has no attribute 'save_statevector'


I have looked at the answers from the following URLs:

I still am not able to fix the issue. Help would be much appreciated.

• What Qiskit version do you have? Aug 4, 2021 at 18:08
• qiskit==0.24.1 qiskit-aer==0.7.6 qiskit-aqua==0.8.2 qiskit-ibmq-provider==0.12.2 qiskit-ignis==0.5.2 qiskit-terra==0.16.4 Aug 4, 2021 at 20:43

According to Qiskit's release notes, it seems that save_statevector is added in version 0.25 (Aer 0.8.0)