annihilation_operator

Graph.annihilation_operator(dimension, offset=0, *, name=None)

Create an annihilation operator in the truncated Fock space.

Parameters
  • dimension (int) – The size of the state representation in the truncated Fock space. By default, the Fock space is truncated as [0, dimension). If non-zero offset is passed, the space is then truncated at [offset, dimension + offset).

  • offset (int, optional) – The lowest level of Fock state in the representation. Defaults to 0.

  • name (str, optional) – The name of the node.

Returns

A 2D tensor representing the annihilation operator.

Return type

Tensor

See also

coherent_state()

Create a coherent state (or a batch of them).

creation_operator()

Create a creation operator in the truncated Fock space.

fock_state()

Create a Fock state (or a batch of them).

number_operator()

Create a number operator in the truncated Fock space.

Examples

Generate an annihilation operator for a two-level system.

>>> graph.annihilation_operator(2, name="a")
<Tensor: name="a", operation_name="annihilation_operator", shape=(2, 2)>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["a"])
>>> result.output["a"]["value"]
array([[0.+0.j, 1.+0.j],
       [0.+0.j, 0.+0.j]])

Apply an annihilation operator on the excited state such that \(a|1\rangle = |0\rangle\).

>>> a = graph.annihilation_operator(2)
>>> state = a @ graph.fock_state(2, 1)[:, None]
>>> state.name = "state"
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["state"])
>>> result.output["state"]["value"]
array([[1.+0.j],
       [0.+0.j]])

Generate an annihilation operator for a three-level system with an offset.

>>> graph.annihilation_operator(3, 1, name="a_offset")
<Tensor: name="a_offset", operation_name="annihilation_operator", shape=(3, 3)>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["a_offset"])
>>> result.output["a_offset"]["value"]
array([[0.+0.j, 1.41421356+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.73205081+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j]])

Apply an annihilation operator with an offset such that \(a|2\rangle = \sqrt{2}|1\rangle\).

>>> a_offset = graph.creation_operator(3, 1)
>>> state_offset = a_offset @ graph.fock_state(3, 2, 1)[:, None]
>>> state.name = "offset"
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["offset"])
>>> result.output["offset"]["value"]
array([[1.41421356+0.j],
       [0.        +0.j],
       [0.        +0.j]])