Embeddings

Submodules

piqture.embeddings.amplitude_encoder module

piqture.embeddings.angle_encoding module

Angle Encoder

class piqture.embeddings.angle_encoding.AngleEncoding(img_dims: tuple[int, ...], pixel_vals: list[list] = None)

Bases: ImageEmbedding

Implements an Angle encoding technique.

property circuit

Returns angle embedding circuit.

embedding() QuantumCircuit

Embeds data using Angle encoding technique.

pixel_position(pixel_pos_binary: str)

Embeds pixel positions on the qubits.

pixel_value(*args, **kwargs)

Embeds pixel or color values on the qubits.

validate_image_dimensions(img_dims)

Validates img_dims input.

validate_number_pixel_lists(pixel_vals)

Validates the number of pixel_lists in pixel_vals input.

static validate_number_pixels(img_dims, pixel_vals)

Validates the number of pixels in pixel_lists in pixel_vals input.

piqture.embeddings.image_embedding module

Abstract Base Class for Image Embedding

class piqture.embeddings.image_embedding.ImageEmbedding(img_dims: tuple[int, ...], pixel_vals: list[list] = None, color_channels: int = 1)

Bases: ABC

Abstract Base Class for embedding image data on a quantum circuit. It consists of two components: - Pixel position embedding - Pixel value (color) embedding - Color channels to indice how many color channels can be represented.

By default, grayscale = 1 color channel, and RGB = 3

property parameters

Returns parameters in an embedding circuit.

abstractmethod pixel_position(pixel_pos_binary: str)

Embeds pixel positions on the qubits.

Args:

pixel_pos_binary (str): takes a binary representation of the pixel position.

abstractmethod pixel_value(*args, **kwargs)

Embeds pixel or color values on the qubits.

validate_image_dimensions(img_dims)

Validates img_dims input.

Here, checks for square images. This function can be overriden.

validate_number_pixel_lists(pixel_vals)

Validates the number of pixel_lists in pixel_vals input.

static validate_number_pixels(img_dims, pixel_vals)

Validates the number of pixels in pixel_lists in pixel_vals input.