workbench_algorithms.subroutines.naive_state_prep
Functions for naïve state preparation.
EfficientMultiplexedRotations
Bases: Qubrick
Decomposition of uniformly controlled rotations to single qubit rotation + CNOTs.
Corresponds to Figure 2 in arXiv:0407010 .
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gate
|
op or None
|
Rotation gate type to use in multiplexed rotations. Defaults to None. |
None
|
angles
|
list or None
|
List of angles to supply to rotations. Defaults to None. |
None
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|
compute
Compute the multiplexed rotation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits / int
|
Index qubits. |
required |
tgt
|
Qubits / int
|
Target qubit. |
required |
ctrl
|
(Qubits, int)
|
A register to control this operation on. Default to |
0
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the compute. |
{}
|
NaiveMultiplexedRotations
Bases: Qubrick
Controlled rotations from arXiv:0407010 .
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gate
|
op or None
|
Rotation gate type to use in multiplexed rotations. Defaults to None. |
None
|
angles
|
list or None
|
List of angles to supply to rotations. Defaults to None |
None
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|
compute
Compute the multiplexed rotation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits / int
|
Index qubits. |
required |
tgt
|
Qubits / int
|
Target qubit. |
required |
ctrl
|
(Qubits, int)
|
A register to control this operation on. Default to |
0
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the compute. |
{}
|
ArbitraryStatePrep
Bases: Qubrick
State preparation based on the routine in arXiv:quant-ph/0407010v1 .
Realizes:
Note
This routine prepares the desired state up to a global phase. When checking the validity of this routine, one should check fidelity rather than exact state vector matching. The other consequence is that controlling this routine will lead to (incorrect) relative phases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
multiplexor
|
(Qubrick, None)
|
Which multiplexing scheme to use in state prep.
Defaults to |
None
|
amps
|
list or None
|
List of amplitudes to load into state. |
required |
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|
compute
Compute the arbitrary state preparation circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qbits
|
Qubits
|
Qubits to operate on. |
required |
ctrl
|
Qubits or int
|
Register to control the on. Defaults to |
0
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the compute. |
{}
|
PrepareNaive
Bases: Qubrick
State preparation based on the routine in arXiv:quant-ph/0407010v1 .
Realizes:
Warning
This function only works for real and positive coefficients
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
multiplexor
|
Qubrick
|
Which multiplexing scheme to use in state prep.
Defaults to |
None
|
coeffs
|
list or None
|
List of coefficients to load into state. |
required |
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|
compute
Compute the state preparation circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qbits
|
Qubits
|
Qubits to operate on. |
required |
ctrl
|
(Qubits, int)
|
A register to control this operation on. Default to |
0
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the compute. |
{}
|