qulacs ================ .. py:module:: qulacs .. autoapi-nested-parse:: cppsim python interface Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 1 circuit/index.rst converter/index.rst gate/index.rst observable/index.rst quantum_operator/index.rst state/index.rst utils/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: qulacs.CausalConeSimulator qulacs.ClsNoisyEvolution qulacs.ClsNoisyEvolution_fast qulacs.ClsNpairQubitGate qulacs.ClsOneControlOneTargetGate qulacs.ClsOneQubitGate qulacs.ClsOneQubitRotationGate qulacs.ClsPauliGate qulacs.ClsPauliRotationGate qulacs.ClsReversibleBooleanGate qulacs.ClsStateReflectionGate qulacs.ClsTwoQubitGate qulacs.DensityMatrix qulacs.GeneralQuantumOperator qulacs.GradCalculator qulacs.NoiseSimulator qulacs.Observable qulacs.ParametricQuantumCircuit qulacs.PauliOperator qulacs.QuantumCircuit qulacs.QuantumCircuitSimulator qulacs.QuantumGateBase qulacs.QuantumGateDiagonalMatrix qulacs.QuantumGateMatrix qulacs.QuantumGateSparseMatrix qulacs.QuantumGate_Adaptive qulacs.QuantumGate_CP qulacs.QuantumGate_CPTP qulacs.QuantumGate_Probabilistic qulacs.QuantumGate_SingleParameter qulacs.QuantumState qulacs.QuantumStateBase qulacs.SimulationResult Functions ~~~~~~~~~ .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`StateVector` - StateVector * - :py:obj:`check_build_for_mpi` - * - :py:obj:`to_general_quantum_operator` - .. py:class:: CausalConeSimulator(arg0: ParametricQuantumCircuit, arg1: Observable) .. py:method:: build() -> None Build .. py:method:: get_circuit_list() -> list[list[ParametricQuantumCircuit]] Return circuit_list .. py:method:: get_coef_list() -> list[complex] Return coef_list .. py:method:: get_expectation_value() -> complex Return expectation_value .. py:method:: get_pauli_operator_list() -> list[list[PauliOperator]] Return pauli_operator_list .. py:class:: ClsNoisyEvolution Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsNoisyEvolution_fast Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsNpairQubitGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsOneControlOneTargetGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsOneQubitGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsOneQubitRotationGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsPauliGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsPauliRotationGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsReversibleBooleanGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsStateReflectionGate Bases: :py:obj:`QuantumGateBase` .. py:class:: ClsTwoQubitGate Bases: :py:obj:`QuantumGateBase` .. py:class:: DensityMatrix(qubit_count: int) Bases: :py:obj:`QuantumStateBase` .. py:method:: add_state(state: QuantumStateBase) -> None Add state vector to this state .. py:method:: allocate_buffer() -> DensityMatrix Allocate buffer with the same size .. py:method:: copy() -> DensityMatrix Create copied insntace .. py:method:: get_classical_value(index: int) -> int Get classical value .. py:method:: get_device_name() -> str Get allocated device name .. py:method:: get_entropy() -> float Get entropy .. py:method:: get_marginal_probability(measured_values: list[int]) -> float Get merginal probability for measured values .. py:method:: get_matrix() -> numpy.ndarray Get density matrix .. py:method:: get_qubit_count() -> int Get qubit count .. py:method:: get_squared_norm() -> float Get squared norm .. py:method:: get_zero_probability(index: int) -> float Get probability with which we obtain 0 when we measure a qubit .. py:method:: load(state: QuantumStateBase) -> None load(state: list[complex]) -> None load(state: numpy.ndarray) -> None Load quantum state represented as a two-dimensional list .. py:method:: multiply_coef(coef: complex) -> None Multiply coefficient to this state .. py:method:: normalize(squared_norm: float) -> None Normalize quantum state .. py:method:: sampling(sampling_count: int) -> list[int] sampling(sampling_count: int, random_seed: int) -> list[int] Sampling measurement results .. py:method:: set_Haar_random_state() -> None set_Haar_random_state(seed: int) -> None Set Haar random state .. py:method:: set_classical_value(index: int, value: int) -> None Set classical value .. py:method:: set_computational_basis(comp_basis: int) -> None Set state to computational basis .. py:method:: set_zero_state() -> None Set state to |0> .. py:method:: to_json() -> str to json string .. py:method:: to_string() -> str to string .. py:class:: GeneralQuantumOperator(qubit_count: int) .. py:method:: add_operator(pauli_operator: PauliOperator) -> None add_operator(coef: complex, pauli_string: str) -> None Add Pauli operator .. py:method:: add_operator_copy(pauli_operator: PauliOperator) -> None Add Pauli operator .. py:method:: add_operator_move(pauli_operator: PauliOperator) -> None Add Pauli operator .. py:method:: apply_to_state(work_state: QuantumStateBase, state_to_be_multiplied: QuantumStateBase, dst_state: QuantumStateBase) -> None apply_to_state(state_to_be_multiplied: QuantumStateBase, dst_state: QuantumStateBase) -> None Apply observable to `state_to_be_multiplied`. The result is stored into `dst_state`. .. py:method:: copy() -> GeneralQuantumOperator Create copied instance of General Quantum operator class .. py:method:: get_expectation_value(state: QuantumStateBase) -> complex Get expectation value .. py:method:: get_expectation_value_single_thread(state: QuantumStateBase) -> complex Get expectation value .. py:method:: get_matrix() -> scipy.sparse.csr_matrix Get the Hermitian matrix representation of the observable .. py:method:: get_qubit_count() -> int Get qubit count .. py:method:: get_state_dim() -> int Get state dimension .. py:method:: get_term(index: int) -> PauliOperator Get Pauli term .. py:method:: get_term_count() -> int Get count of Pauli terms .. py:method:: get_transition_amplitude(state_bra: QuantumStateBase, state_ket: QuantumStateBase) -> complex Get transition amplitude .. py:method:: is_hermitian() -> bool Get is Herimitian .. py:method:: to_json() -> str to json string .. py:class:: GradCalculator .. py:method:: calculate_grad(parametric_circuit: ParametricQuantumCircuit, observable: Observable) -> list[complex] calculate_grad(parametric_circuit: ParametricQuantumCircuit, observable: Observable, angles_of_gates: list[float]) -> list[complex] Calculate Grad .. py:class:: NoiseSimulator(arg0: QuantumCircuit, arg1: QuantumState) .. py:method:: execute(arg0: int) -> list[int] Sampling & Return result [array] .. py:method:: execute_and_get_result(arg0: int) -> SimulationResult Simulate & Return ressult [array of (state, frequency)] .. py:class:: Observable(qubit_count: int) Bases: :py:obj:`GeneralQuantumOperator` .. py:method:: add_operator(pauli_operator: PauliOperator) -> None add_operator(coef: complex, string: str) -> None Add Pauli operator .. py:method:: add_operator_copy(pauli_operator: PauliOperator) -> None Add Pauli operator .. py:method:: add_operator_move(pauli_operator: PauliOperator) -> None Add Pauli operator .. py:method:: add_random_operator(operator_count: int) -> None add_random_operator(operator_count: int, seed: int) -> None Add random pauli operator .. py:method:: apply_to_state(work_state: QuantumStateBase, state_to_be_multiplied: QuantumStateBase, dst_state: QuantumStateBase) -> None Apply observable to `state_to_be_multiplied`. The result is stored into `dst_state`. .. py:method:: get_expectation_value(state: QuantumStateBase) -> float Get expectation value .. py:method:: get_expectation_value_single_thread(state: QuantumStateBase) -> float Get expectation value .. py:method:: get_qubit_count() -> int Get qubit count .. py:method:: get_state_dim() -> int Get state dimension .. py:method:: get_term(index: int) -> PauliOperator Get Pauli term .. py:method:: get_term_count() -> int Get count of Pauli terms .. py:method:: get_transition_amplitude(state_bra: QuantumStateBase, state_ket: QuantumStateBase) -> complex Get transition amplitude .. py:method:: solve_ground_state_eigenvalue_by_arnoldi_method(state: QuantumStateBase, iter_count: int, mu: complex = 0.0) -> complex Compute ground state eigenvalue by arnoldi method .. py:method:: solve_ground_state_eigenvalue_by_lanczos_method(state: QuantumStateBase, iter_count: int, mu: complex = 0.0) -> complex Compute ground state eigenvalue by lanczos method .. py:method:: solve_ground_state_eigenvalue_by_power_method(state: QuantumStateBase, iter_count: int, mu: complex = 0.0) -> complex Compute ground state eigenvalue by power method .. py:class:: ParametricQuantumCircuit(qubit_count: int) Bases: :py:obj:`QuantumCircuit` .. py:method:: add_gate(gate: QuantumGateBase) -> None add_gate(gate: QuantumGateBase, position: int) -> None Add gate .. py:method:: add_parametric_RX_gate(index: int, angle: float) -> None Add parametric Pauli-X rotation gate .. py:method:: add_parametric_RY_gate(index: int, angle: float) -> None Add parametric Pauli-Y rotation gate .. py:method:: add_parametric_RZ_gate(index: int, angle: float) -> None Add parametric Pauli-Z rotation gate .. py:method:: add_parametric_gate(gate: QuantumGate_SingleParameter) -> None add_parametric_gate(gate: QuantumGate_SingleParameter, position: int) -> None Add parametric gate .. py:method:: add_parametric_multi_Pauli_rotation_gate(index_list: list[int], pauli_ids: list[int], angle: float) -> None Add parametric multi-qubit Pauli rotation gate .. py:method:: backprop(obs: GeneralQuantumOperator) -> list[float] Do backprop .. py:method:: backprop_inner_product(state: QuantumState) -> list[float] Do backprop with innder product .. py:method:: copy() -> ParametricQuantumCircuit Create copied instance .. py:method:: get_parameter(index: int) -> float Get parameter .. py:method:: get_parameter_count() -> int Get parameter count .. py:method:: get_parametric_gate_position(index: int) -> int Get parametric gate position .. py:method:: merge_circuit(circuit: ParametricQuantumCircuit) -> None Merge another ParametricQuantumCircuit .. py:method:: remove_gate(position: int) -> None Remove gate .. py:method:: set_parameter(index: int, parameter: float) -> None Set parameter .. py:class:: PauliOperator(coef: complex = 1 + 0j) PauliOperator(pauli_string: str, coef: complex = 1 + 0j) PauliOperator(target_qubit_index_list: list[int], pauli_operator_type_list: str, coef: complex = 1 + 0j) .. py:method:: add_single_Pauli(index: int, pauli_type: int) -> None Add Pauli operator to this term .. py:method:: change_coef(new_coef: complex) -> None Change coefficient .. py:method:: copy() -> PauliOperator Create copied instance of Pauli operator class .. py:method:: get_coef() -> complex Get coefficient of Pauli term .. py:method:: get_expectation_value(state: QuantumStateBase) -> complex Get expectation value .. py:method:: get_expectation_value_single_thread(state: QuantumStateBase) -> complex Get expectation value .. py:method:: get_index_list() -> list[int] Get list of target qubit indices .. py:method:: get_pauli_id_list() -> list[int] Get list of Pauli IDs (I,X,Y,Z) = (0,1,2,3) .. py:method:: get_pauli_string() -> str Get pauli string .. py:method:: get_transition_amplitude(state_bra: QuantumStateBase, state_ket: QuantumStateBase) -> complex Get transition amplitude .. py:class:: QuantumCircuit(qubit_count: int) .. py:method:: add_CNOT_gate(control: int, target: int) -> None Add CNOT gate .. py:method:: add_CZ_gate(control: int, target: int) -> None Add CZ gate .. py:method:: add_FusedSWAP_gate(target1: int, target2: int, block_size: int) -> None Add FusedSWAP gate .. py:method:: add_H_gate(index: int) -> None Add Hadamard gate .. py:method:: add_P0_gate(index: int) -> None Add projection gate to |0> subspace .. py:method:: add_P1_gate(index: int) -> None Add projection gate to |1> subspace .. py:method:: add_RX_gate(index: int, angle: float) -> None Add Pauli-X rotation gate .. rubric:: Notes Matrix Representation .. math:: R_X(\theta) = \exp(i\frac{\theta}{2} X) = \begin{pmatrix} \cos(\frac{\theta}{2}) & i\sin(\frac{\theta}{2}) \\ i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RY_gate(index: int, angle: float) -> None Add Pauli-Y rotation gate .. rubric:: Notes Matrix Representation .. math:: R_Y(\theta) = \exp(i\frac{\theta}{2} Y) = \begin{pmatrix} \cos(\frac{\theta}{2}) & \sin(\frac{\theta}{2}) \\ -\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RZ_gate(index: int, angle: float) -> None Add Pauli-Z rotation gate .. rubric:: Notes Matrix Representation .. math:: R_Z(\theta) = \exp(i\frac{\theta}{2} Z) = \begin{pmatrix} e^{i\frac{\theta}{2}} & 0 \\ 0 & e^{-i\frac{\theta}{2}} \end{pmatrix} .. py:method:: add_RotInvX_gate(index: int, angle: float) -> None Add Pauli-X rotation gate .. rubric:: Notes Matrix Representation .. math:: R_X(\theta) = \exp(i\frac{\theta}{2} X) = \begin{pmatrix} \cos(\frac{\theta}{2}) & i\sin(\frac{\theta}{2}) \\ i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RotInvY_gate(index: int, angle: float) -> None Add Pauli-Y rotation gate .. rubric:: Notes Matrix Representation .. math:: R_Y(\theta) = \exp(i\frac{\theta}{2} Y) = \begin{pmatrix} \cos(\frac{\theta}{2}) & \sin(\frac{\theta}{2}) \\ -\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RotInvZ_gate(index: int, angle: float) -> None Add Pauli-Z rotation gate .. rubric:: Notes Matrix Representation .. math:: R_Z(\theta) = \exp(i\frac{\theta}{2} Z) = \begin{pmatrix} e^{i\frac{\theta}{2}} & 0 \\ 0 & e^{-i\frac{\theta}{2}} \end{pmatrix} .. py:method:: add_RotX_gate(index: int, angle: float) -> None Add Pauli-X rotation gate .. rubric:: Notes Matrix Representation .. math:: RotX(\theta) = \exp(-i\frac{\theta}{2} X) = \begin{pmatrix} \cos(\frac{\theta}{2}) & -i\sin(\frac{\theta}{2}) \\ -i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RotY_gate(index: int, angle: float) -> None Add Pauli-Y rotation gate .. rubric:: Notes Matrix Representation .. math:: RotY(\theta) = \exp(-i\frac{\theta}{2} Y) = \begin{pmatrix} \cos(\frac{\theta}{2}) & -\sin(\frac{\theta}{2}) \\ \sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix} .. py:method:: add_RotZ_gate(index: int, angle: float) -> None Add Pauli-Z rotation gate .. rubric:: Notes Matrix Representation .. math:: RotZ(\theta) = \exp(-i\frac{\theta}{2} Z) = \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{pmatrix} .. py:method:: add_SWAP_gate(target1: int, target2: int) -> None Add SWAP gate .. py:method:: add_S_gate(index: int) -> None Add pi/4 phase gate .. py:method:: add_Sdag_gate(index: int) -> None Add adjoint of pi/4 phsae gate .. py:method:: add_T_gate(index: int) -> None Add pi/8 phase gate .. py:method:: add_Tdag_gate(index: int) -> None Add adjoint of pi/8 phase gate .. py:method:: add_U1_gate(index: int, lambda_: float) -> None Add QASM U1 gate .. py:method:: add_U2_gate(index: int, phi: float, lambda_: float) -> None Add QASM U2 gate .. py:method:: add_U3_gate(index: int, theta: float, phi: float, lambda_: float) -> None Add QASM U3 gate .. py:method:: add_X_gate(index: int) -> None Add Pauli-X gate .. py:method:: add_Y_gate(index: int) -> None Add Pauli-Y gate .. py:method:: add_Z_gate(index: int) -> None Add Pauli-Z gate .. py:method:: add_dense_matrix_gate(index: int, matrix: numpy.ndarray) -> None add_dense_matrix_gate(index_list: list[int], matrix: numpy.ndarray) -> None Add dense matrix gate .. py:method:: add_diagonal_observable_rotation_gate(observable: Observable, angle: float) -> None Add diagonal observable rotation gate .. py:method:: add_gate(gate: QuantumGateBase) -> None add_gate(gate: QuantumGateBase, position: int) -> None Add gate with copy .. py:method:: add_multi_Pauli_gate(index_list: list[int], pauli_ids: list[int]) -> None add_multi_Pauli_gate(pauli: PauliOperator) -> None Add multi-qubit Pauli gate .. py:method:: add_multi_Pauli_rotation_gate(index_list: list[int], pauli_ids: list[int], angle: float) -> None add_multi_Pauli_rotation_gate(pauli: PauliOperator) -> None Add multi-qubit Pauli rotation gate .. py:method:: add_noise_gate(gate: QuantumGateBase, NoiseType: str, NoiseProbability: float) -> None Add noise gate with copy .. py:method:: add_observable_rotation_gate(observable: Observable, angle: float, repeat: int) -> None Add observable rotation gate .. py:method:: add_random_unitary_gate(index_list: list[int]) -> None add_random_unitary_gate(index_list: list[int], seed: int) -> None Add random unitary gate .. py:method:: add_sqrtX_gate(index: int) -> None Add pi/4 Pauli-X rotation gate .. py:method:: add_sqrtXdag_gate(index: int) -> None Add adjoint of pi/4 Pauli-X rotation gate .. py:method:: add_sqrtY_gate(index: int) -> None Add pi/4 Pauli-Y rotation gate .. py:method:: add_sqrtYdag_gate(index: int) -> None Add adjoint of pi/4 Pauli-Y rotation gate .. py:method:: calculate_depth() -> int Calculate depth of circuit .. py:method:: copy() -> QuantumCircuit Create copied instance .. py:method:: get_gate(position: int) -> QuantumGateBase Get gate instance .. py:method:: get_gate_count() -> int Get gate count .. py:method:: get_inverse() -> QuantumCircuit get inverse circuit .. py:method:: get_qubit_count() -> int Get qubit count .. py:method:: merge_circuit(circuit: QuantumCircuit) -> None .. py:method:: remove_gate(position: int) -> None Remove gate .. py:method:: to_json() -> str .. py:method:: to_string() -> str Get string representation .. py:method:: update_quantum_state(state: QuantumStateBase) -> None update_quantum_state(state: QuantumStateBase, start: int, end: int) -> None update_quantum_state(state: QuantumStateBase, seed: int) -> None update_quantum_state(state: QuantumStateBase, start: int, end: int, seed: int) -> None Update quantum state .. py:class:: QuantumCircuitSimulator(circuit: QuantumCircuit, state: QuantumStateBase) .. py:method:: copy_state_from_buffer() -> None Copy buffer to state .. py:method:: copy_state_to_buffer() -> None Copy state to buffer .. py:method:: get_expectation_value(observable: Observable) -> complex Get expectation value .. py:method:: get_gate_count() -> int Get gate count .. py:method:: initialize_random_state() -> None initialize_random_state(seed: int) -> None Initialize state with random pure state .. py:method:: initialize_state(arg0: int) -> None Initialize state .. py:method:: simulate() -> None Simulate circuit .. py:method:: simulate_range(start: int, end: int) -> None Simulate circuit .. py:method:: swap_state_and_buffer() -> None Swap state and buffer .. py:class:: QuantumGateBase .. py:method:: copy() -> QuantumGateBase Create copied instance .. py:method:: get_control_index_list() -> list[int] Get control qubit index list .. py:method:: get_control_index_value_list() -> list[tuple[int, int]] Get control qubit pair index value list .. py:method:: get_control_value_list() -> list[int] Get control qubit value list .. py:method:: get_inverse() -> QuantumGateBase get inverse gate .. py:method:: get_matrix() -> numpy.ndarray Get gate matrix .. py:method:: get_name() -> str Get gate name .. py:method:: get_target_index_list() -> list[int] Get target qubit index list .. py:method:: is_Clifford() -> bool Check this gate is element of Clifford group .. py:method:: is_Gaussian() -> bool Check this gate is element of Gaussian group .. py:method:: is_Pauli() -> bool Check this gate is element of Pauli group .. py:method:: is_commute(gate: QuantumGateBase) -> bool Check this gate commutes with a given gate .. py:method:: is_diagonal() -> bool Check the gate matrix is diagonal .. py:method:: is_parametric() -> bool Check this gate is parametric gate .. py:method:: to_json() -> str to json string .. py:method:: to_string() -> str to string .. py:method:: update_quantum_state(state: QuantumStateBase) -> None Update quantum state .. py:class:: QuantumGateDiagonalMatrix Bases: :py:obj:`QuantumGateBase` .. py:class:: QuantumGateMatrix Bases: :py:obj:`QuantumGateBase` .. py:method:: add_control_qubit(index: int, control_value: int) -> None Add control qubit .. py:method:: multiply_scalar(value: complex) -> None Multiply scalar value to gate matrix .. py:class:: QuantumGateSparseMatrix Bases: :py:obj:`QuantumGateBase` .. py:class:: QuantumGate_Adaptive Bases: :py:obj:`QuantumGateBase` .. py:class:: QuantumGate_CP Bases: :py:obj:`QuantumGateBase` .. py:method:: get_gate_list() -> list[QuantumGateBase] get_gate_list .. py:class:: QuantumGate_CPTP Bases: :py:obj:`QuantumGateBase` QuantumGate_Instrument .. py:method:: get_gate_list() -> list[QuantumGateBase] get_gate_list .. py:class:: QuantumGate_Probabilistic Bases: :py:obj:`QuantumGateBase` QuantumGate_ProbabilisticInstrument .. py:method:: get_cumulative_distribution() -> list[float] get_cumulative_distribution .. py:method:: get_distribution() -> list[float] get_distribution .. py:method:: get_gate_list() -> list[QuantumGateBase] get_gate_list .. py:method:: optimize_ProbablisticGate() -> None optimize_ProbablisticGate .. py:class:: QuantumGate_SingleParameter Bases: :py:obj:`QuantumGateBase` .. py:method:: copy() -> QuantumGate_SingleParameter Create copied instance .. py:method:: get_parameter_value() -> float Get parameter value .. py:method:: set_parameter_value(value: float) -> None Set parameter value .. py:class:: QuantumState(qubit_count: int) QuantumState(qubit_count: int, use_multi_cpu: bool) Bases: :py:obj:`QuantumStateBase` .. py:method:: add_state(state: QuantumStateBase) -> None Add state vector to this state .. py:method:: allocate_buffer() -> QuantumState Allocate buffer with the same size .. py:method:: copy() -> QuantumState Create copied instance .. py:method:: get_amplitude(comp_basis: int) -> complex Get Amplitude of a specified computational basis .. py:method:: get_classical_value(index: int) -> int Get classical value .. py:method:: get_device_name() -> str Get allocated device name .. py:method:: get_entropy() -> float Get entropy .. py:method:: get_marginal_probability(measured_values: list[int]) -> float Get merginal probability for measured values .. py:method:: get_qubit_count() -> int Get qubit count .. py:method:: get_squared_norm() -> float Get squared norm .. py:method:: get_vector() -> numpy.ndarray Get state vector .. py:method:: get_zero_probability(index: int) -> float Get probability with which we obtain 0 when we measure a qubit .. py:method:: load(state: QuantumStateBase) -> None load(state: list[complex]) -> None Load quantum state vector .. py:method:: multiply_coef(coef: complex) -> None Multiply coefficient to this state .. py:method:: multiply_elementwise_function(func: Callable[[int], complex]) -> None Multiply elementwise function .. py:method:: normalize(squared_norm: float) -> None Normalize quantum state .. py:method:: sampling(sampling_count: int) -> list[int] sampling(sampling_count: int, random_seed: int) -> list[int] Sampling measurement results .. py:method:: set_Haar_random_state() -> None set_Haar_random_state(seed: int) -> None Set Haar random state .. py:method:: set_classical_value(index: int, value: int) -> None Set classical value .. py:method:: set_computational_basis(comp_basis: int) -> None Set state to computational basis .. py:method:: set_zero_state() -> None Set state to |0> .. py:method:: to_json() -> str to json string .. py:method:: to_string() -> str to string .. py:class:: QuantumStateBase .. py:class:: SimulationResult .. py:method:: get_count() -> int get state count .. py:method:: get_frequency(arg0: int) -> int get state frequency .. py:method:: get_state(arg0: int) -> QuantumState get state .. py:function:: StateVector(arg0: int) -> QuantumState StateVector .. py:function:: check_build_for_mpi() -> bool .. py:function:: to_general_quantum_operator(gate: QuantumGateBase, qubits: int, tol: float) -> GeneralQuantumOperator