Skip to content

Feature request: Modify QPE to handle user-defined block encodings #73

Description

@cferenba

phase_estimation.py contains the following block of code:

            self._block_encoding          =  block_encoding
            self._block_encoding_ctl      =  getEncoding( instance=self._block_encoding.PI,
                                                          encoding=self._block_encoding._encoding_type, 
                                                          control_val=1 )

The getEncoding call returns a new encoding of the same type as block_encoding, by comparing the type of block_encoding to the explicit list of all pyLIQTR-provided block encodings. If block_encoding is some other type (e.g., a user-defined type), an error is raised.

I think the explicit list of block-encoding types could be removed by replacing the getEncoding call with something like this:

            self._block_encoding_ctl      =  type(block_encoding)( ...,
                                                                   control_val=1 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions