Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
LocalPreparationBasis¶
- class LocalPreparationBasis(name, instructions=None, default_states=None, qubit_states=None)[source]¶
Local tensor-product preparation basis.
This basis consists of a set of 1-qubit instructions which are used to define a tensor-product basis on N-qubits.
Initialize a fitter preparation basis.
- Parameters:
name (
str) – a name to identify the basis.instructions (
Optional[Sequence[Instruction]]) – list of 1-qubit instructions for preparing states from the \(|0\rangle\) state.default_states (
Union[List[QuantumState],Dict[Tuple[int,...],QuantumState],None]) – Optional, default density matrices prepared by the input instructions. If None these will be determined by ideal simulation of the preparation instructions.qubit_states (
Optional[Dict[Tuple[int,...],Union[List[QuantumState],Dict[Tuple[int,...],QuantumState]]]]) – Optional, a dict with physical qubit keys and a list of density matrices prepared by the list of basis instructions for a specific qubit. The default states will be used for any qubits not specified in this dict.
- Raises:
QiskitError – If input states or instructions are not valid, or no instructions or states are provided.
Attributes
Return the basis name
Methods
LocalPreparationBasis.circuit(index[, qubits])Return the basis preparation circuit.
Return the shape for the specified number of indices.
LocalPreparationBasis.matrix(index[, qubits])Return the density matrix data array for the index and qubits.
Return the shape of subsystem dimensions of the state attr:~matrix.