GME Evaluation¶
- gme.first_coefficients_generation(n)[source]¶
Generates the very first coefficients for the calculation of GME by quantum walk algorithm.
- Example :
>>> first_coefficients_generation(3) [[-0.11275809+0.60216392j -0.47908013+0.62862266j] [-0.366532 -0.25643112j 0.67716151-0.58425138j] [ 0.74835654-0.53252389j -0.3953533 -0.00874982j]]
- Parameters:
n (int) – The number of qubits.
- Returns:
np.array[list[complex]] – A table of n lists containing three (03) coefficients.
- gme.gme_best_calculation(n, psi, step, alpha_min, c_max)[source]¶
- Maximizes GME. The algorithm used here is called the Random walk method.
The principle is simple. We randomly generate first parameters which are used to calculate GME. The first value of GME is called first_gme. Then, we calculate new parameters based on the previous ones and a variable called the descent step. With the new parameters, we calculate a new value of GME. If this value is better than the previous one, we keep it and continue the researches until a counter is at its maximum value. The goal here is to take a big circle of research scope and to reduce it (by decreasing the decent step) more and more until the maximum value of GME is found.
- Parameters:
n (int) – The number of qubits.
psi (list[complex]) – The vector for the calculation of GME.
step (int) – The initial value of the descent step.
alpha_min (float) – The minimum value of the descent step (which is the length of the radius).
c_max (int) – The maximum value of the counter.
- Returns:
float – The value that is, expectedly, Mu, the optimal maximal value of the gme.
- gme.gme_calculation(vector, psi)[source]¶
Calculates “GME”, the result of the calculation of the vector with the generated one, formed to be “separable”.
- Parameters:
vector (np.array[complex]) – The separable, ie non entangled vector.
psi (np.array[complex]) – The state vector from which the gme is computed.
- Returns:
float – The value of the calculation.
- gme.new_coefficients_generation(n, old_coefficients, step)[source]¶
Generates randomly new parameters for GME maximization by quantum walk algorithm.
- Parameters:
n (int) – The number of qubits
old_coefficients (np.array[list[complex]]) – The table of the coefficients that didn’t maximize the gme
step (float) – The value of the step (used in the random walk algorithm)
- Returns:
np.array[list[complex]] – Table of new coefficients
- gme.vector_calculation(n, coeffs, first_base=array([1, 0]), second_base=array([0, 1]))[source]¶
Calculation of the vector on which the GME will be calculated. This vector depends on the basis which can be |0> or |00>. The default value is the first mentioned.
- Parameters:
- Returns:
np.array[list[complex]] – Vector of length 2^n