title: qiskit VQC with Amplitude Encoding for state preparation
body: <p>I am trying to implement a Quantum Neural Network in qiskit, using the VQC class.</p>
  <p>The problem is that each data consists in 190 features, which just can't be encoded with the default VQC's function (ZZfeatureMap), since this would mean create a circuit with 190 qubits.</p>
  <p>The solution that I would like to adopt is the Amplitude Encoding, which would allow me to use only 8 qubits (with 256 amplitudes = 190 features + 66 zeros).
  How can I implement a parameterized circuit in qiskit that performs this ?</p>
  <p>I tried with the following (as an example on 2 qubits), but just doesn't work:</p>
  <pre><code>custom_circ = QuantumCircuit(2)
  x = ParameterVector('x', 4)
  
  custom_circ.initialize(x)
  </code></pre>
  <p><strong>EDIT:</strong></p>
  <p>My problem is not with the parameteres, but with the Amplitude Encoding.
  Usually, if I need to Encode a vector of 4 numbers in 2 Qbits, I just do the following:</p>
  <pre><code>circuit = QuantumCircuit(2)
  vector = [0.124, -0.124, 0.124, 0.124]
  circuit.initialize(vector)
  </code></pre>
  <p>In this way I encode my vector as amplitudes of the Qubits.
  But now I need to parameterize this (the vector is not fixed).
  The problem is that the &quot;initialize&quot; function doesn't accept parameters:</p>
  <blockquote>
  <p>Traceback (most recent call last):</p>
  <p>[...]</p>
  <p>File &quot;D: ... \qiskit\extensions\quantum_initializer\initializer.py&quot;, line 455, in initialize</p>
  <p>return self.append(Initialize(params, num_qubits), qubits)</p>
  <p>File &quot;D: ... \qiskit\extensions\quantum_initializer\initializer.py&quot;, line 89, in <strong>init</strong></p>
  <p>if not math.isclose(sum(np.absolute(params) ** 2), 1.0,</p>
  <p>TypeError: bad operand type for abs(): 'Parameter'</p>
  </blockquote>
  <p>Is there a way to create and amplitude encoding that is also parameterized?</p>
  <p><strong>EDIT 2:</strong>
  I resolved the problem, Thank You.
  If you want to parameterize the Initialize circuit just use <a href="https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.circuit.library.RawFeatureVector.html#qiskit_machine_learning.circuit.library.RawFeatureVector" rel="nofollow noreferrer">RawFeatureVector</a>.</p>