RawFeatureVector
class RawFeatureVector(feature_dimension=2)
Raw Feature Vector feature map.
The Raw Feature Vector can be directly used as a feature map, where the raw feature vectors will be automatically padded with ending 0s as necessary, to make sure vector length is a power of 2, and normalized such that it can be treated and used as an initial quantum state vector.
Parameters
feature_dimension (int
) – The feature dimension, has a minimum value of 1.
Attributes
feature_dimension
returns feature dimension
num_qubits
returns number of qubits
support_parameterized_circuit
returns whether or not the sub-class support parameterized circuit
Methods
construct_circuit
RawFeatureVector.construct_circuit(x, qr=None, inverse=False)
Construct the second order expansion based on given data.
Parameters
- x (numpy.ndarray) – 1-D to-be-encoded data.
- qr (QuantumRegister) – the QuantumRegister object for the circuit, if None, generate new registers with name q.
- inverse (bool) – inverse
Returns
a quantum circuit transform data x.
Return type
Raises
- TypeError – invalid input
- ValueError – invalid input
get_entangler_map
static RawFeatureVector.get_entangler_map(map_type, num_qubits)
get entangle map
validate_entangler_map
static RawFeatureVector.validate_entangler_map(entangler_map, num_qubits)
validate entangler map