distributed#
Distributed operations
Functions
|
A subroutine of dist_many_ctrl_one_targ_gate. |
|
Apply a multi-control single-qubit gate or its derivative to a distributed state vector. |
|
Apply a multi-qubit gate to a distributed state vector. |
|
Apply a single-qubit gate to a distributed state vector. |
|
Apply a SWAP gate to a distributed state vector. |
|
Map global target qubits to available local indices for distributed gates. |
|
Get the inner product of two distributed state vectors. |
|
Apply a gate to a state vector locally. |
|
Apply a multi-control single-qubit gate to a state vector locally. |
|
Apply a SWAP gate to a state vector locally. |
|
Measure a distributed state vector. |
- dist_ctrl_sub(state: DistributedQubitState, controls: list[int], target: int, matrix: Tensor, derivative: bool = False) DistributedQubitState[source]#
A subroutine of dist_many_ctrl_one_targ_gate.
See https://arxiv.org/abs/2311.01512 Alg.8
- dist_many_ctrl_one_targ_gate(state: DistributedQubitState, controls: list[int], target: int, matrix: Tensor, derivative: bool = False) DistributedQubitState[source]#
Apply a multi-control single-qubit gate or its derivative to a distributed state vector.
See https://arxiv.org/abs/2311.01512 Alg.7
- dist_many_targ_gate(state: DistributedQubitState, targets: list[int], matrix: Tensor) DistributedQubitState[source]#
Apply a multi-qubit gate to a distributed state vector.
See https://arxiv.org/abs/2311.01512 Alg.10
- dist_one_targ_gate(state: DistributedQubitState, target: int, matrix: Tensor) DistributedQubitState[source]#
Apply a single-qubit gate to a distributed state vector.
See https://arxiv.org/abs/2311.01512 Alg.6
- dist_swap_gate(state: DistributedQubitState, qb1: int, qb2: int)[source]#
Apply a SWAP gate to a distributed state vector.
See https://arxiv.org/abs/2311.01512 Alg.9
- get_local_targets(targets: list[int], nqubit_local: int) list[int][source]#
Map global target qubits to available local indices for distributed gates.
- inner_product_dist(bra: DistributedQubitState, ket: DistributedQubitState) Tensor[source]#
Get the inner product of two distributed state vectors.
- local_gate(state: Tensor, targets: list[int], matrix: Tensor) Tensor[source]#
Apply a gate to a state vector locally.
- local_many_ctrl_one_targ_gate(state: Tensor, controls: list[int], target: int, matrix: Tensor, derivative: bool = False) Tensor[source]#
Apply a multi-control single-qubit gate to a state vector locally.
See https://arxiv.org/abs/2311.01512 Alg.3
- local_swap_gate(state: Tensor, target1: int, target2: int) Tensor[source]#
Apply a SWAP gate to a state vector locally.
- measure_dist(state: DistributedQubitState, shots: int = 1024, with_prob: bool = False, wires: int | list[int] | None = None, block_size: int = 16777216) dict[source]#
Measure a distributed state vector.