Gates

This submodule provides the necessary components to define and manipulate quantum gates for use in digital quantum circuits.

Simple Gates

Use these constructors to apply standard single- and two-qubit operations:

Controlled Gates

Any basic gate can be turned into a controlled gate using the Controlled class:

from qilisdk.digital.gates import Controlled, Y

controlled_y = Controlled(0, basic_gate=Y(1))
multiple_controlled_y = Controlled(0, 1, basic_gate=Y(2))

Or alternatively, you can use the .controlled() method on any gate instance:

from qilisdk.digital.gates import Y

controlled_y = Y(1).controlled(0)
multiple_controlled_y = Y(2).controlled(0, 1)

Adjoint Gates

You can create the Hermitian conjugate (dagger) of a gate either using the Adjoint class or using the .adjoint() method on any gate instance:

from qilisdk.digital.gates import Adjoint, Y

adjoint_y = Adjoint(basic_gate=Y(1))
adjoint_y = Y(1).adjoint()

Exponential Gates

To apply a gate as an exponential operator, use either the Exponential class or the .exponential() method on any gate instance:

from qilisdk.digital.gates import Exponential, Y

exp_y = Exponential(basic_gate=Y(1))
exp_y = Y(1).exponential()