Provide QFT and inverse-QFT as ordinary named qkernels.
Overview¶
| Function | Description |
|---|---|
configure_composite | Configure a QKernel to remain visible as a named composite call. |
iqft | Apply the inverse quantum Fourier transform. |
qft | Apply the standard quantum Fourier transform. |
| Class | Description |
|---|---|
CallPolicy | Describe the default lowering policy for a callable call. |
CompositeGateType | Classify 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:
| Name | Type | Description |
|---|---|---|
kernel | QKernel[..., Any] | Kernel to configure. |
name | str | None | Public callable name. Defaults to the kernel name. |
namespace | str | None | Explicit stable callable namespace. None derives one from the decorated function’s module, qualified name, and source location. Defaults to None. |
gate_type | CompositeGateType | Internal stdlib classification. Defaults to CUSTOM. |
policy | CallPolicy | Lowering policy. Defaults to PRESERVE_BOX. |
implementations | Sequence[CallableImplementation] | None | Optional implementation candidates. |
semantic_arguments | Mapping[str, Any] | None | Serializer-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:
| Name | Type | Description |
|---|---|---|
qubits | Vector[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:
| Name | Type | Description |
|---|---|---|
qubits | Vector[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¶
INLINENATIVE_FIRSTPRESERVE_BOX
CompositeGateType [source]¶
class CompositeGateType(enum.Enum)Classify standard boxed quantum callables.
Attributes¶
CUSTOMIQFTQFTQPE