qalgebra.library.fock_operators module

Collection of operators that act on a bosonic Fock space

Summary

Classes:

Create

Bosonic creation operator

Destroy

Bosonic annihilation operator

Displace

Unitary coherent displacement operator.

Phase

Unitary “phase” operator

Squeeze

Unitary squeezing operator.

__all__: Create, Destroy, Displace, Phase, Squeeze

Reference

class qalgebra.library.fock_operators.Destroy(*, hs)[source]

Bases: qalgebra.core.operator_algebra.LocalOperator

Bosonic annihilation operator

It obeys the bosonic commutation relation:

>>> Destroy(hs=1) * Create(hs=1) - Create(hs=1) * Destroy(hs=1)
IdentityOperator
>>> Destroy(hs=1) * Create(hs=2) - Create(hs=2) * Destroy(hs=1)
ZeroOperator
property identifier

The identifier (symbol) that is used when printing the annihilation operator. This is identical to the identifier of Create. A custom identifier for both Destroy and Create can be set through the local_identifiers parameter of the associated Hilbert space:

>>> hs_custom = LocalSpace(0, local_identifiers={'Destroy': 'b'})
>>> Create(hs=hs_custom).identifier
'b'
>>> Destroy(hs=hs_custom).identifier
'b'
class qalgebra.library.fock_operators.Create(*, hs)[source]

Bases: qalgebra.core.operator_algebra.LocalOperator

Bosonic creation operator

This is the adjoint of Destroy.

property identifier

The identifier (symbols) that is used when printing the creation operator. This is identical to the identifier of Destroy

class qalgebra.library.fock_operators.Phase(*args, hs)[source]

Bases: qalgebra.core.operator_algebra.LocalOperator

Unitary “phase” operator

\[\op{P}_{\rm hs}(\phi) = \exp\left(i \phi \Op{a}_{\rm hs}^\dagger \Op{a}_{\rm hs}\right)\]

where \(a_{\rm hs}\) is the annihilation operator acting on the LocalSpace hs.

Parameters
  • phase (Scalar) – the phase \(\phi\)

  • hs (HilbertSpace or int or str) – The Hilbert space on which the operator acts

Printers should represent this operator with the default identifier:

>>> Phase._identifier
'Phase'

A custom identifier may be define using hs’s local_identifiers argument.

simplifications = [<function implied_local_space.<locals>.kwargs_to_local_space>, <function match_replace>]
property phase

The phase argument, as a Scalar instance.

class qalgebra.library.fock_operators.Displace(*args, hs)[source]

Bases: qalgebra.core.operator_algebra.LocalOperator

Unitary coherent displacement operator.

\[\op{D}_{\rm hs}(\alpha) = \exp\left({\alpha \Op{a}_{\rm hs}^\dagger - \alpha^* \Op{a}_{\rm hs}}\right)\]

where \(\Op{a}_{\rm hs}\) is the annihilation operator acting on the LocalSpace hs.

Parameters
  • displacement (Scalar) – the displacement amplitude \(\alpha\)

  • hs (HilbertSpace or int or str) – The Hilbert space on which the operator acts

Printers should represent this operator with the default identifier:

>>> Displace._identifier
'D'

A custom identifier may be define using hs’s local_identifiers argument.

simplifications = [<function implied_local_space.<locals>.kwargs_to_local_space>, <function match_replace>]
property displacement

The displacement argument, as a Scalar instance.

class qalgebra.library.fock_operators.Squeeze(*args, hs)[source]

Bases: qalgebra.core.operator_algebra.LocalOperator

Unitary squeezing operator.

\[\Op{S}_{\rm hs}(\eta) = \exp {\left( \frac{\eta}{2} \left(\Op{a}_{\rm hs}^\dagger\right)^2 - \frac{\eta^*}{2} {\Op{a}_{\rm hs}}^2 \right)}\]

where \(\Op{a}_{\rm hs}\) is the annihilation operator acting on the LocalSpace hs.

Parameters
  • squeezing_factor (Scalar) – the squeezing factor \(\eta\)

  • hs (HilbertSpace or int or str) – The Hilbert space on which the operator acts

Printers should represent this operator with the default identifier:

>>> Squeeze._identifier
'Squeeze'

A custom identifier may be define using hs’s local_identifiers argument.

simplifications = [<function implied_local_space.<locals>.kwargs_to_local_space>, <function match_replace>]
property squeezing_factor

The squeezing_factor argument, as a Scalar instance.