mpsprep.helpers.generate_target_state

mpsprep.helpers.generate_target_state(num_qubits, case, seed=None, sparsity=None, sigma=None, period=None)[source]

Generates a target state for the state preparation circuit.

Parameters
num_qubitsint

Number of qubits.

casestr
Case of the target state. Can be one of the following:
  • random: Random distribution, sparsity must be specified, seed

    may be specified.

  • normal: Normal distribution, sigma is optional.

  • lognormal: Lognormal distribution, sigma is optional.

  • sine: Sine wave, period is optional.

seedint, optional

Random seed used for random distribution. The default is None.

sparsityfloat, required for random case only

Sparsity of the random distribution. The default is None.

sigmafloat, optional

Standard deviation of the normal distribution. The default is None.

periodfloat, optional

Period of the sine wave. The default is None.

Returns
target_statenp.ndarray

Target statevector.