Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

SVD.train

SVD.train(data)[source]

Train the SVD on the given data.

Each element of the given data will be converted to a 2D array of dimension n_qubits x 2. The number of qubits is inferred from the shape of the data. For each qubit the data is collected into an array of shape 2 x n_data_points. The mean of the in-phase a quadratures is subtracted before passing the data to numpy’s svd function. The dominant axis and the scale is saved for each qubit so that future data points can be projected onto the axis.

Note

Before training the SVD the mean of the training data is subtracted from the training data to avoid large offsets in the data. These means can be retrieved with parameters.i_means or parameters.q_means for I and Q quadrature, respectively.

Parameters:

data (ndarray) – A data array to be trained. This is a single numpy array containing all circuit results input to the data processor.