Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

InitialState

class InitialState

GitHub

Base class for InitialState.

This method should initialize the module and use an exception if a component of the module is not available.


Attributes

bitstr


Methods

construct_circuit

abstract InitialState.construct_circuit(mode='circuit', register=None)

Construct the statevector of desired initial state.

Parameters

  • mode (str) – vector or circuit. The vector mode produces the vector. While the circuit constructs the quantum circuit corresponding that vector.
  • register (Optional[QuantumRegister]) – qubits for circuit construction.

Returns

statevector.

Return type

QuantumCircuit or numpy.ndarray

Raises

AquaError – when mode is not ‘vector’ or ‘circuit’.

Was this page helpful?
Report a bug or request content on GitHub.