piqture.embeddings.image_embeddings package

Submodules

piqture.embeddings.image_embeddings.brqi module

Bitplane Representation of Quantum Images (BRQI)

class piqture.embeddings.image_embeddings.brqi.BRQI(img_dims: tuple[int, int], pixel_vals: list[list] | ndarray, max_color_intensity: int = 255)

Bases: ImageEmbedding, ImageMixin

Represents images in BRQI representation format.

brqi() QuantumCircuit

Builds the BRQI image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the BRQI image representation.

property circuit

Returns BRQI circuit.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit.

Args:

*args: Variable length argument list. **kwargs: Arbitrary keyword arguments.

color_byte (str): Binary representation of the color value.

validate_max_color_intensity()

Validate the maximum color intensity value.

Raises:

ValueError: If max_color_intensity is less than 0 or greater than 255

validate_number_pixel_lists(pixel_vals)

Validates the number of pixel_lists in pixel_vals input.

piqture.embeddings.image_embeddings.frqi module

Flexible Representation of Quantum Images (FRQI)

class piqture.embeddings.image_embeddings.frqi.FRQI(img_dims: tuple[int, int], pixel_vals: list[list] = None)

Bases: ImageEmbedding, ImageMixin

Represents images in FRQI representation format

property circuit

Returns the FRQI circuit.

frqi() QuantumCircuit

Builds the FRQI image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the frqi image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit

piqture.embeddings.image_embeddings.ineqr module

Improved Novel Enhanced Quantum Representation (INEQR) of digital images

class piqture.embeddings.image_embeddings.ineqr.INEQR(img_dims: tuple[int, int], pixel_vals: list[list[list]], max_color_intensity: int = 255)

Bases: NEQR

Represents images in INEQR representation format. It is an enhanced version of the existing NEQR image representation method which helps in representing rectangular images on a quantum circuit.

References:

[1] N. Jiang and L. Wang, “Quantum image scaling using nearest neighbor interpolation,” Quantum Information Processing, vol. 14, no. 5, pp. 1559–1571, Sep. 2014, doi: https://doi.org/10.1007/s11128-014-0841-8.

property circuit

Returns INEQR circuit.

ineqr() QuantumCircuit

Builds the INEQR image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the INEQR image representation.

validate_image_dimensions(img_dims)

Override existing method in ABC.

static validate_number_pixels(img_dims, pixel_vals)

Validates the number of pixels in pixel_lists in pixel_vals input.

piqture.embeddings.image_embeddings.mcrqi module

Multi-Channel Representation of Quantum Image (MCRQI)

class piqture.embeddings.image_embeddings.mcrqi.MCRQI(img_dims: tuple[int, int], pixel_vals: list[list] = None)

Bases: ImageEmbedding

Represents image in RBG-alpha color space on a quantum circuit, where RBG is the color channel and alpha represents transparency in an image [1].

References:

[1] “A Multi-Channel Representation for images on quantum computers using the RGBα color space | IEEE Conference Publication | IEEE Xplore,” ieeexplore.ieee.org. https://ieeexplore.ieee.org/document/6051718.

channel_index(channel_index_binary: str, qubit_padding: int)

Embeds color index on the qubits.

property circuit

Returns MCRQI circuit.

mcrqi() QuantumCircuit

Builds the MCRQI image representation with RGB-alpha color channels on a circuit.

Returns:

QuantumCircuit: final circuit with the MCRQI image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit

piqture.embeddings.image_embeddings.neqr module

Novel Enhanced Quantum Representation (NEQR) of digital images

class piqture.embeddings.image_embeddings.neqr.NEQR(img_dims: tuple[int, int], pixel_vals: list[list], max_color_intensity: int = 255)

Bases: ImageEmbedding, ImageMixin

Represents images in NEQR representation format.

property circuit

Returns NEQR circuit.

neqr() QuantumCircuit

Builds the NEQR image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the frqi image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit

Module contents

Quantum Image Representations (module: piqture.embeddings.image_embeddings)

class piqture.embeddings.image_embeddings.BRQI(img_dims: tuple[int, int], pixel_vals: list[list] | ndarray, max_color_intensity: int = 255)

Bases: ImageEmbedding, ImageMixin

Represents images in BRQI representation format.

brqi() QuantumCircuit

Builds the BRQI image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the BRQI image representation.

property circuit

Returns BRQI circuit.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit.

Args:

*args: Variable length argument list. **kwargs: Arbitrary keyword arguments.

color_byte (str): Binary representation of the color value.

validate_max_color_intensity()

Validate the maximum color intensity value.

Raises:

ValueError: If max_color_intensity is less than 0 or greater than 255

validate_number_pixel_lists(pixel_vals)

Validates the number of pixel_lists in pixel_vals input.

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

Bases: ImageEmbedding, ImageMixin

Represents images in FRQI representation format

property circuit

Returns the FRQI circuit.

frqi() QuantumCircuit

Builds the FRQI image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the frqi image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit

class piqture.embeddings.image_embeddings.INEQR(img_dims: tuple[int, int], pixel_vals: list[list[list]], max_color_intensity: int = 255)

Bases: NEQR

Represents images in INEQR representation format. It is an enhanced version of the existing NEQR image representation method which helps in representing rectangular images on a quantum circuit.

References:

[1] N. Jiang and L. Wang, “Quantum image scaling using nearest neighbor interpolation,” Quantum Information Processing, vol. 14, no. 5, pp. 1559–1571, Sep. 2014, doi: https://doi.org/10.1007/s11128-014-0841-8.

property circuit

Returns INEQR circuit.

ineqr() QuantumCircuit

Builds the INEQR image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the INEQR image representation.

validate_image_dimensions(img_dims)

Override existing method in ABC.

static validate_number_pixels(img_dims, pixel_vals)

Validates the number of pixels in pixel_lists in pixel_vals input.

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

Bases: ImageEmbedding

Represents image in RBG-alpha color space on a quantum circuit, where RBG is the color channel and alpha represents transparency in an image [1].

References:

[1] “A Multi-Channel Representation for images on quantum computers using the RGBα color space | IEEE Conference Publication | IEEE Xplore,” ieeexplore.ieee.org. https://ieeexplore.ieee.org/document/6051718.

channel_index(channel_index_binary: str, qubit_padding: int)

Embeds color index on the qubits.

property circuit

Returns MCRQI circuit.

mcrqi() QuantumCircuit

Builds the MCRQI image representation with RGB-alpha color channels on a circuit.

Returns:

QuantumCircuit: final circuit with the MCRQI image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit

class piqture.embeddings.image_embeddings.NEQR(img_dims: tuple[int, int], pixel_vals: list[list], max_color_intensity: int = 255)

Bases: ImageEmbedding, ImageMixin

Represents images in NEQR representation format.

property circuit

Returns NEQR circuit.

neqr() QuantumCircuit

Builds the NEQR image representation on a circuit.

Returns:

QuantumCircuit: final circuit with the frqi image representation.

pixel_position(pixel_pos_binary: str)

Embeds pixel position values in a circuit.

pixel_value(*args, **kwargs)

Embeds pixel (color) values in a circuit