Bengali
ভাষাসমূহ
English
Bengali
French
Hindi
Italian
Japanese
Korean
Malayalam
Russian
Spanish
Tamil
Turkish
Vietnamese
Shortcuts



QuantumGenerator

class QuantumGenerator(bounds, num_qubits, generator_circuit=None, init_params=None, optimizer=None, gradient_function=None, snapshot_dir=None)[source]

Bases: qiskit_machine_learning.algorithms.distribution_learners.qgan.generative_network.GenerativeNetwork

Quantum Generator.

The quantum generator is a parametrized quantum circuit which can be trained with the QGAN algorithm to generate a quantum state which approximates the probability distribution of given training data. At the beginning of the training the parameters will be set randomly, thus, the output will is random. Throughout the training the quantum generator learns to represent the target distribution. Eventually, the trained generator can be used for state preparation e.g. in QAE.

প্যারামিটার
  • bounds (ndarray) -- k min/max data values [[min_1,max_1],...,[min_k,max_k]], given input data dim k

  • num_qubits (Union[List[int], ndarray]) -- k numbers of qubits to determine representation resolution, i.e. n qubits enable the representation of 2**n values [n_1,..., n_k]

  • generator_circuit (Optional[QuantumCircuit]) -- a QuantumCircuit implementing the generator.

  • init_params (Union[List[float], ndarray, None]) -- 1D numpy array or list, Initialization for the generator's parameters.

  • optimizer (Optional[Optimizer]) -- optimizer to be used for the training of the generator

  • gradient_function (Union[Callable, Gradient, None]) -- A Gradient object, or a function returning partial derivatives of the loss function w.r.t. the generator variational params.

  • snapshot_dir (Optional[str]) -- str or None, if not None save the optimizer's parameter after every update step to the given directory

রেইজেস

QiskitMachineLearningError -- Set multivariate variational distribution to represent multivariate data

Attributes

discriminator

Get discriminator.

optimizer

Get optimizer.

parameter_values

Get parameter values from the quantum generator

seed

Get seed.

Methods

construct_circuit([params])

Construct generator circuit.

get_output(quantum_instance[, params, shots])

Get classical data samples from the generator.

loss(x, weights)

Loss function for training the generator's parameters.

train([quantum_instance, shots])

Perform one training step w.r.t to the generator's parameters