noise_test_bank_functions

Auxiliary functions for using with the demo notebook: NoisyModels.ipynb

QQuantLib.qpu.noise_test_bank_functions.create_arrays(price_problem)

This function creates the mandatory arrays for configuring an option price estimation problem for notebook NoisyModels.ipynb

Parameters:

price_problem (dict) – Python dictionary with a complete dictionary for configuring the arrays for a option price estimation problem

Returns:

  • domain (numpy array) – numpy array with the domain for the price estimation problem

  • norm_pay_off (array) – numpy array with the normalised payoff

  • norm_p_x (numpy array) – numpy array with the normalised probability density

  • pay_off_normalisation (float) – normalization constant for the payoff

  • p_x_normalisation (float) – normalization constant for the probability density

QQuantLib.qpu.noise_test_bank_functions.first_step(epsilon, ratio, gamma)

Configuration of the first step for a RQAE algorithm. This is an auxiliary function for notebook NoisyModels.ipynb

Parameters:
  • epsilon (float) – epsilon for RQAE

  • ratio (float) – ratio (q) for RQAE

  • gamma (float) – gamma for RQAE

Returns:

  • shift (float) – shift for first step of RQAE

  • n_i (int) – number of shots for first step of RQAE

  • gamma_i (float) – failure probability for first step of RQAE

  • theoretical_epsilon (float) – theoretical epsilon for first step of RQAE