Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

qamomile.circuit.qft

Provide QFT and inverse-QFT as ordinary named qkernels.

Overview

FunctionDescription
configure_compositeConfigure a QKernel to remain visible as a named composite call.
iqftApply the inverse quantum Fourier transform.
qftApply the standard quantum Fourier transform.
ClassDescription
CallPolicyDescribe the default lowering policy for a callable call.
CompositeGateTypeClassify standard boxed quantum callables.

Functions

configure_composite [source]

def configure_composite(
    kernel: QKernel[..., Any],
    *,
    name: str | None = None,
    namespace: str | None = None,
    gate_type: CompositeGateType = CompositeGateType.CUSTOM,
    policy: CallPolicy = CallPolicy.PRESERVE_BOX,
    implementations: Sequence[CallableImplementation] | None = None,
    semantic_arguments: Mapping[str, Any] | None = None,
) -> QKernel[..., Any]

Configure a QKernel to remain visible as a named composite call.

This mutates and returns the same QKernel object. No wrapper class or alternate call protocol is introduced.

Parameters:

NameTypeDescription
kernelQKernel[..., Any]Kernel to configure.
namestr | NonePublic callable name. Defaults to the kernel name.
namespacestr | NoneExplicit stable callable namespace. None derives one from the decorated function’s module, qualified name, and source location. Defaults to None.
gate_typeCompositeGateTypeInternal stdlib classification. Defaults to CUSTOM.
policyCallPolicyLowering policy. Defaults to PRESERVE_BOX.
implementationsSequence[CallableImplementation] | NoneOptional implementation candidates.
semantic_argumentsMapping[str, Any] | NoneSerializer-friendly arguments that are part of the operation’s meaning rather than its decomposition. Defaults to no semantic arguments.

Returns:

QKernel[..., Any] — QKernel[..., Any]: The same configured kernel instance.


iqft [source]

def iqft(qubits: Vector[Qubit]) -> Vector[Qubit]

Apply the inverse quantum Fourier transform.

Parameters:

NameTypeDescription
qubitsVector[Qubit]Register to transform.

Returns:

Vector[Qubit] — Vector[Qubit]: Transformed register.


qft [source]

def qft(qubits: Vector[Qubit]) -> Vector[Qubit]

Apply the standard quantum Fourier transform.

The Qamomile body remains attached to the named invocation for every register width. Backends may emit a native QFT, while other backends lower this same body during emission.

Parameters:

NameTypeDescription
qubitsVector[Qubit]Register to transform.

Returns:

Vector[Qubit] — Vector[Qubit]: Transformed register.

Classes

CallPolicy [source]

class CallPolicy(enum.Enum)

Describe the default lowering policy for a callable call.

Attributes


CompositeGateType [source]

class CompositeGateType(enum.Enum)

Classify standard boxed quantum callables.

Attributes