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.

PauliPreparationBasis

class PauliPreparationBasis[source]

Minimal 4-element Pauli measurement basis.

This is a minimal size 4 preparation basis where each qubit index corresponds to the following initial state preparation circuits and density matrices:

Table 2 Single-qubit preparation circuits and states

Index

State

Preparation Circuit

Density Matrix

0

Zp

-[I]-

[[1, 0], [0, 0]]

1

Zm

-[X]-

[[0, 0], [0, 1]]

2

Xp

-[H]-

[[0.5, 0.5], [0.5, 0.5]]

3

Yp

-[H]-[S]-

[[0.5, -0.5j], [0.5j, 0.5]]

Initialize Pauli preparation basis

Attributes

name

Return the basis name

Methods

circuit(index, qubits=None)

Return the basis preparation circuit.

Parameters:
  • index (Sequence[int]) – a list of basis elements to tensor together.

  • qubits (Sequence[int] | None) – Optional, the physical qubit subsystems for the index. If None this will be set to (0, ..., N-1) for a length N index.

Returns:

The logical basis circuit for the specified index and qubits.

Return type:

QuantumCircuit

Note

This returns a logical circuit on the specified number of qubits and should be remapped to the corresponding physical qubits during experiment transpilation.

index_shape(qubits)

Return the shape for the specified number of indices.

Parameters:

qubits (Sequence[int]) – the basis subsystems to return the index shape for.

Returns:

The shape of allowed values for the index on the specified qubits.

Return type:

Tuple[int, …]

matrix(index, qubits=None)

Return the density matrix data array for the index and qubits.

This state is used by tomography fitters for reconstruction and should correspond to the target state for the corresponding preparation circuit().

Parameters:
  • index (Sequence[int]) – a list of subsystem basis indices.

  • qubits (Sequence[int] | None) – Optional, the physical qubit subsystems for the index. If None this will be set to (0, ..., N-1) for a length N index.

Returns:

The density matrix prepared by the specified index and qubits.

matrix_shape(qubits)

Return the shape of subsystem dimensions of the state matrix.

Parameters:

qubits (Sequence[int]) – the physical qubit subsystems.

Returns:

A tuple of subsystem dimensions for the specified qubits.

Return type:

Tuple[int, …]