mpsprep.helpers
Helper functions for the Matrix Product State-based state preparation
Helper functions that are used in the MPS technique, or just generally helpful when using this technique.
Functions
|
Given a list of singular values, this function returns the index of the singular value that is the best valid candidate for truncation. |
|
Returns a binary string that is nqubits wide, with the least significant bit at the right. |
|
Given a list of singular values, this function returns the list of singular values after truncating the singular values below the given threshold. |
|
Given a number of qubits, a sparsity, and a number of random samples to generate, this function returns the mean fractional entropy of the generated samples. |
|
Generates a target state for the state preparation circuit. |
|
Given a list of singular values, this function returns the ratio of the largest singular value to the smallest singular value. |
|
Given an array of amplitudes y_amp that define the quantum state \(|y> = \sum_i y_{amp}[i] |i>\), this function returns the mean fractional entropy of \(|y>\). |
|
Given a list of singular values from multiple SVDs, this function returns the rank of each matrix in the SVDs as a list. |
|
Given two statevectors, this function returns the fidelity between the two states. |
|
Given a list of singular values, this function returns the list of singular values after dropping the singular value at the given index. |
|
Given a kwargs dict, this function updates it with the key, value pair of default_kwargs if the key in default_kwargs is not found in kwargs. |