qbraid.transpiler.Conversion

class Conversion(source, target, conversion_func)[source]

Class for defining and handling custom conversions between different quantum program packages.

Initialize a Conversion instance with source and target packages and a conversion function.

Parameters:
  • source (str) – The source package from which conversion starts.

  • target (str) – The target package to which conversion is done.

  • conversion_func (Callable) – The function that performs the actual conversion.

__init__(source, target, conversion_func)[source]

Initialize a Conversion instance with source and target packages and a conversion function.

Parameters:
  • source (str) – The source package from which conversion starts.

  • target (str) – The target package to which conversion is done.

  • conversion_func (Callable) – The function that performs the actual conversion.

Methods

__init__(source, target, conversion_func)

Initialize a Conversion instance with source and target packages and a conversion function.

convert(program)

Convert a quantum program from the source package to the target package.

Attributes

native

True if the conversion function is native to qbraid package, False otherwise.

source

The source package of the conversion.

supported

True if all packages required to perform the conversion are installed.

target

The target package of the conversion.