pdft.bases.TEBDBasis#

class pdft.bases.TEBDBasis(m, n, tensors=None, phases=None, code=None, inv_code=None, seed=None, parametrization='cp')[source]#

Bases: _LayeredBasis

2D TEBD basis with row + column rings of controlled-phase gates.

Mirror of upstream src/basis.jl:600-745.

Parameters:
__init__(m, n, tensors=None, phases=None, code=None, inv_code=None, seed=None, parametrization='cp')#

A seed without phases draws one phase per gate of the two layers.

parametrization is “cp” (diagonal gates on U(1)^4) or “u4” (dense two-qubit gates on U(4), the canonical form of both circuits).

Parameters:

Methods

__init__(m, n[, tensors, phases, code, ...])

A seed without phases draws one phase per gate of the two layers.

forward_transform(pic)

gates_per_register(n_qubits)

Number of gates in the ring of one register: one per qubit, the wrap-around included.

inverse_transform(pic)

conj(tensors) through inv_code, exactly like Julia's basis.inverse_code(conj.(basis.tensors)..., ...).

layered(m, n, *[, phases, parametrization])

Return (gates, n_row_gates, n_col_gates).

Attributes

freezes_to_blocked

image_size

inv_tensors

The tensor list itself.

num_parameters

n_row_gates

n_col_gates

m

n

tensors

program

code

inv_code

emit

static layered(m, n, *, phases=None, parametrization='cp')#

Return (gates, n_row_gates, n_col_gates).

Mirror of upstream src/tebd.jl:48-110.

The circuit is:
  1. H on each of the m+n qubits.

  2. Row ring: ring gate (i, i+1) for i=1..m-1, then wrap-around (m, 1).

  3. Col ring: ring gate (m+i, m+i+1) for i=1..n-1, then wrap-around (m+n, m+1).

parametrization is "cp" (diagonal, U(1)^4) or "u4" (dense two-qubit, U(4) — the canonical TEBD gate). Both start from the same operator for a given phases; see the module docstring.

Step 1, the split of phases between the two rings and the choice of gate form are hadamards_then_layers, which MERA uses too. What is TEBD’s own is the ring of one register, _ring.

Parameters:
Return type:

tuple[list[Gate], int, int]

static gates_per_register(n_qubits)#

Number of gates in the ring of one register: one per qubit, the wrap-around included.

Parameters:

n_qubits (int)

Return type:

int