qml.utils.expand_vector¶
- expand_vector(vector, original_wires, expanded_wires)[source]¶
Expand a vector to more wires.
- Parameters
vector (array) – \(2^n\) vector where n = len(original_wires).
original_wires (Sequence[int]) – original wires of vector
expanded_wires (Union[Sequence[int], int]) – expanded wires of vector, can be shuffled If a single int m is given, corresponds to list(range(m))
- Returns
\(2^m\) vector where m = len(expanded_wires).
- Return type
array
code/api/pennylane.utils.expand_vector
Download Python script
Download Notebook
View on GitHub