distributed#

Distributed operations

Functions

dist_gate(state, targets, matrix)

Apply a gate to a distributed Fock state tensor.

dist_swap_gate(state, target1, target2)

Apply a SWAP operation to a distributed Fock state tensor.

get_digit(decimal, target, cutoff)

Get the digit of a decimal number at a specific position.

get_pair_rank(rank, target_rank, new_digit, ...)

Get the pair rank for communication.

local_gate(state, targets, matrix)

Apply a gate to a Fock state tensor locally.

local_swap_gate(state, target1, target2)

Apply a SWAP operation to a Fock state tensor locally.

measure_dist(state[, shots, with_prob, ...])

Measure a distributed Fock state tensor.

dist_gate(state: DistributedFockState, targets: list[int], matrix: Tensor) DistributedFockState[source]#

Apply a gate to a distributed Fock state tensor.

dist_swap_gate(state: DistributedFockState, target1: int, target2: int)[source]#

Apply a SWAP operation to a distributed Fock state tensor.

get_digit(decimal: int, target: int, cutoff: int) int[source]#

Get the digit of a decimal number at a specific position.

get_pair_rank(rank: int, target_rank: int, new_digit: int, cutoff: int, ndigit: int) int[source]#

Get the pair rank for communication.

local_gate(state: Tensor, targets: list[int], matrix: Tensor) Tensor[source]#

Apply a gate to a Fock state tensor locally.

local_swap_gate(state: Tensor, target1: int, target2: int) Tensor[source]#

Apply a SWAP operation to a Fock state tensor locally.

measure_dist(state: DistributedFockState, shots: int = 1024, with_prob: bool = False, wires: int | list[int] | None = None, block_size: int = 16777216) dict[source]#

Measure a distributed Fock state tensor.