Python API リファレンス

qulacs

cppsim python interface

class qulacs.DensityMatrix

ベースクラス: qulacs.QuantumStateBase

add_state(self: qulacs.DensityMatrix, arg0: qulacs.QuantumStateBase) → None
allocate_buffer(self: qulacs.DensityMatrix) → qulacs.QuantumStateBase
copy(self: qulacs.DensityMatrix) → qulacs.QuantumStateBase
data_c(self: qulacs.DensityMatrix) → doublecomplex
data_cpp(self: qulacs.DensityMatrix) → complex
get_classical_value(self: qulacs.DensityMatrix, arg0: int) → int
get_device_name(self: qulacs.DensityMatrix) → str
get_entropy(self: qulacs.DensityMatrix) → float
get_marginal_probability(self: qulacs.DensityMatrix, arg0: List[int]) → float
get_matrix(self: qulacs.DensityMatrix) → numpy.ndarray[complex128[m, n]]
get_squared_norm(self: qulacs.DensityMatrix) → float
get_zero_probability(self: qulacs.DensityMatrix, arg0: int) → float
load(*args, **kwargs)

Overloaded function.

  1. load(self: qulacs.DensityMatrix, arg0: qulacs.QuantumStateBase) -> None

  2. load(self: qulacs.DensityMatrix, arg0: List[complex]) -> None

  3. load(self: qulacs.DensityMatrix, arg0: numpy.ndarray[complex128[m, n]]) -> None

multiply_coef(self: qulacs.DensityMatrix, arg0: complex) → None
normalize(self: qulacs.DensityMatrix, arg0: float) → None
sampling(self: qulacs.DensityMatrix, arg0: int) → List[int]
set_Haar_random_state(*args, **kwargs)

Overloaded function.

  1. set_Haar_random_state(self: qulacs.DensityMatrix) -> None

  2. set_Haar_random_state(self: qulacs.DensityMatrix, arg0: int) -> None

set_classical_value(self: qulacs.DensityMatrix, arg0: int, arg1: int) → None
set_computational_basis(self: qulacs.DensityMatrix, arg0: int) → None
set_zero_state(self: qulacs.DensityMatrix) → None
to_string(self: qulacs.DensityMatrix) → str
class qulacs.GeneralQuantumOperator

ベースクラス: pybind11_builtins.pybind11_object

add_operator(*args, **kwargs)

Overloaded function.

  1. add_operator(self: qulacs.GeneralQuantumOperator, arg0: qulacs.PauliOperator) -> None

  2. add_operator(self: qulacs.GeneralQuantumOperator, arg0: complex, arg1: str) -> None

get_expectation_value(self: qulacs.GeneralQuantumOperator, arg0: QuantumStateBase) → complex
get_qubit_count(self: qulacs.GeneralQuantumOperator) → int
get_state_dim(self: qulacs.GeneralQuantumOperator) → int
get_term(self: qulacs.GeneralQuantumOperator, arg0: int) → qulacs.PauliOperator
get_term_count(self: qulacs.GeneralQuantumOperator) → int
get_transition_amplitude(self: qulacs.GeneralQuantumOperator, arg0: QuantumStateBase, arg1: QuantumStateBase) → complex
is_hermitian(self: qulacs.GeneralQuantumOperator) → bool
class qulacs.Observable

ベースクラス: qulacs.GeneralQuantumOperator

add_operator(*args, **kwargs)

Overloaded function.

  1. add_operator(self: qulacs.Observable, arg0: qulacs.PauliOperator) -> None

  2. add_operator(self: qulacs.Observable, arg0: complex, arg1: str) -> None

get_expectation_value(self: qulacs.Observable, arg0: QuantumStateBase) → float
get_qubit_count(self: qulacs.Observable) → int
get_state_dim(self: qulacs.Observable) → int
get_term(self: qulacs.Observable, arg0: int) → qulacs.PauliOperator
get_term_count(self: qulacs.Observable) → int
get_transition_amplitude(self: qulacs.Observable, arg0: QuantumStateBase, arg1: QuantumStateBase) → complex
class qulacs.ParametricQuantumCircuit

ベースクラス: qulacs.QuantumCircuit

add_gate(*args, **kwargs)

Overloaded function.

  1. add_gate(self: qulacs.ParametricQuantumCircuit, arg0: qulacs.QuantumGateBase) -> None

  2. add_gate(self: qulacs.ParametricQuantumCircuit, arg0: qulacs.QuantumGateBase, arg1: int) -> None

add_parametric_RX_gate(self: qulacs.ParametricQuantumCircuit, arg0: int, arg1: float) → None
add_parametric_RY_gate(self: qulacs.ParametricQuantumCircuit, arg0: int, arg1: float) → None
add_parametric_RZ_gate(self: qulacs.ParametricQuantumCircuit, arg0: int, arg1: float) → None
add_parametric_gate(*args, **kwargs)

Overloaded function.

  1. add_parametric_gate(self: qulacs.ParametricQuantumCircuit, arg0: qulacs.QuantumGate_SingleParameter) -> None

  2. add_parametric_gate(self: qulacs.ParametricQuantumCircuit, arg0: qulacs.QuantumGate_SingleParameter, arg1: int) -> None

add_parametric_multi_Pauli_rotation_gate(self: qulacs.ParametricQuantumCircuit, arg0: List[int], arg1: List[int], arg2: float) → None
copy(self: qulacs.ParametricQuantumCircuit) → qulacs.ParametricQuantumCircuit
get_parameter(self: qulacs.ParametricQuantumCircuit, arg0: int) → float
get_parameter_count(self: qulacs.ParametricQuantumCircuit) → int
get_parametric_gate_position(self: qulacs.ParametricQuantumCircuit, arg0: int) → int
remove_gate(self: qulacs.ParametricQuantumCircuit, arg0: int) → None
set_parameter(self: qulacs.ParametricQuantumCircuit, arg0: int, arg1: float) → None
class qulacs.PauliOperator

ベースクラス: pybind11_builtins.pybind11_object

add_single_Pauli(self: qulacs.PauliOperator, arg0: int, arg1: int) → None
copy(self: qulacs.PauliOperator) → qulacs.PauliOperator
get_coef(self: qulacs.PauliOperator) → complex
get_expectation_value(self: qulacs.PauliOperator, arg0: QuantumStateBase) → complex
get_index_list(self: qulacs.PauliOperator) → List[int]
get_pauli_id_list(self: qulacs.PauliOperator) → List[int]
get_transition_amplitude(self: qulacs.PauliOperator, arg0: QuantumStateBase, arg1: QuantumStateBase) → complex
class qulacs.QuantumCircuit

ベースクラス: pybind11_builtins.pybind11_object

add_CNOT_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: int) → None
add_CZ_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: int) → None
add_H_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_P0_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_P1_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_RX_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float) → None
add_RY_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float) → None
add_RZ_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float) → None
add_SWAP_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: int) → None
add_S_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_Sdag_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_T_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_Tdag_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_U1_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float) → None
add_U2_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float, arg2: float) → None
add_U3_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: float, arg2: float, arg3: float) → None
add_X_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_Y_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_Z_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_dense_matrix_gate(*args, **kwargs)

Overloaded function.

  1. add_dense_matrix_gate(self: qulacs.QuantumCircuit, arg0: int, arg1: numpy.ndarray[complex128[m, n]]) -> None

  2. add_dense_matrix_gate(self: qulacs.QuantumCircuit, arg0: List[int], arg1: numpy.ndarray[complex128[m, n]]) -> None

add_diagonal_observable_rotation_gate(self: qulacs.QuantumCircuit, arg0: qulacs.Observable, arg1: float) → None
add_gate(*args, **kwargs)

Overloaded function.

  1. add_gate(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumGateBase) -> None

  2. add_gate(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumGateBase, arg1: int) -> None

add_gate_consume(*args, **kwargs)

Overloaded function.

  1. add_gate_consume(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumGateBase) -> None

  2. add_gate_consume(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumGateBase, arg1: int) -> None

add_multi_Pauli_gate(*args, **kwargs)

Overloaded function.

  1. add_multi_Pauli_gate(self: qulacs.QuantumCircuit, arg0: List[int], arg1: List[int]) -> None

  2. add_multi_Pauli_gate(self: qulacs.QuantumCircuit, arg0: qulacs.PauliOperator) -> None

add_multi_Pauli_rotation_gate(*args, **kwargs)

Overloaded function.

  1. add_multi_Pauli_rotation_gate(self: qulacs.QuantumCircuit, arg0: List[int], arg1: List[int], arg2: float) -> None

  2. add_multi_Pauli_rotation_gate(self: qulacs.QuantumCircuit, arg0: qulacs.PauliOperator) -> None

add_observable_rotation_gate(self: qulacs.QuantumCircuit, arg0: qulacs.Observable, arg1: float, arg2: int) → None
add_random_unitary_gate(self: qulacs.QuantumCircuit, arg0: List[int]) → None
add_sqrtX_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_sqrtXdag_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_sqrtY_gate(self: qulacs.QuantumCircuit, arg0: int) → None
add_sqrtYdag_gate(self: qulacs.QuantumCircuit, arg0: int) → None
calculate_depth(self: qulacs.QuantumCircuit) → int
copy(self: qulacs.QuantumCircuit) → qulacs.QuantumCircuit
get_gate(self: qulacs.QuantumCircuit, arg0: int) → qulacs.QuantumGateBase
get_gate_count(self: qulacs.QuantumCircuit) → int
get_qubit_count(self: qulacs.QuantumCircuit) → int
remove_gate(self: qulacs.QuantumCircuit, arg0: int) → None
to_string(self: qulacs.QuantumCircuit) → str
update_quantum_state(*args, **kwargs)

Overloaded function.

  1. update_quantum_state(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumStateBase) -> None

  2. update_quantum_state(self: qulacs.QuantumCircuit, arg0: qulacs.QuantumStateBase, arg1: int, arg2: int) -> None

class qulacs.QuantumCircuitSimulator

ベースクラス: pybind11_builtins.pybind11_object

copy_state_from_buffer(self: qulacs.QuantumCircuitSimulator) → None
copy_state_to_buffer(self: qulacs.QuantumCircuitSimulator) → None
get_expectation_value(self: qulacs.QuantumCircuitSimulator, arg0: qulacs.Observable) → complex
get_gate_count(self: qulacs.QuantumCircuitSimulator) → int
get_state_ptr(self: qulacs.QuantumCircuitSimulator) → qulacs.QuantumStateBase
initialize_random_state(self: qulacs.QuantumCircuitSimulator) → None
initialize_state(self: qulacs.QuantumCircuitSimulator, arg0: int) → None
simulate(self: qulacs.QuantumCircuitSimulator) → None
simulate_range(self: qulacs.QuantumCircuitSimulator, arg0: int, arg1: int) → None
swap_state_and_buffer(self: qulacs.QuantumCircuitSimulator) → None
class qulacs.QuantumGateBase

ベースクラス: pybind11_builtins.pybind11_object

copy(self: qulacs.QuantumGateBase) → qulacs.QuantumGateBase
get_control_index_list(self: qulacs.QuantumGateBase) → List[int]
get_matrix(self: qulacs.QuantumGateBase) → numpy.ndarray[complex128[m, n]]
get_name(self: qulacs.QuantumGateBase) → str
get_target_index_list(self: qulacs.QuantumGateBase) → List[int]
is_Clifford(self: qulacs.QuantumGateBase) → bool
is_Gaussian(self: qulacs.QuantumGateBase) → bool
is_Pauli(self: qulacs.QuantumGateBase) → bool
is_commute(self: qulacs.QuantumGateBase, arg0: qulacs.QuantumGateBase) → bool
is_diagonal(self: qulacs.QuantumGateBase) → bool
is_parametric(self: qulacs.QuantumGateBase) → bool
to_string(self: qulacs.QuantumGateBase) → str
update_quantum_state(self: qulacs.QuantumGateBase, arg0: qulacs.QuantumStateBase) → None
class qulacs.QuantumGateMatrix

ベースクラス: qulacs.QuantumGateBase

add_control_qubit(self: qulacs.QuantumGateMatrix, arg0: int, arg1: int) → None
copy(self: qulacs.QuantumGateMatrix) → qulacs.QuantumGateBase
get_matrix(self: qulacs.QuantumGateMatrix) → numpy.ndarray[complex128[m, n]]
multiply_scalar(self: qulacs.QuantumGateMatrix, arg0: complex) → None
to_string(self: qulacs.QuantumGateMatrix) → str
update_quantum_state(self: qulacs.QuantumGateMatrix, arg0: qulacs.QuantumStateBase) → None
class qulacs.QuantumGate_SingleParameter

ベースクラス: qulacs.QuantumGateBase

get_parameter_value(self: qulacs.QuantumGate_SingleParameter) → float
set_parameter_value(self: qulacs.QuantumGate_SingleParameter, arg0: float) → None
class qulacs.QuantumState

ベースクラス: qulacs.QuantumStateBase

add_state(self: qulacs.QuantumState, arg0: qulacs.QuantumStateBase) → None
allocate_buffer(self: qulacs.QuantumState) → qulacs.QuantumStateBase
copy(self: qulacs.QuantumState) → qulacs.QuantumStateBase
data_c(self: qulacs.QuantumState) → doublecomplex
data_cpp(self: qulacs.QuantumState) → complex
get_classical_value(self: qulacs.QuantumState, arg0: int) → int
get_device_name(self: qulacs.QuantumState) → str
get_entropy(self: qulacs.QuantumState) → float
get_marginal_probability(self: qulacs.QuantumState, arg0: List[int]) → float
get_qubit_count(self: qulacs.QuantumState) → int
get_squared_norm(self: qulacs.QuantumState) → float
get_vector(self: qulacs.QuantumState) → numpy.ndarray[complex128[m, 1]]
get_zero_probability(self: qulacs.QuantumState, arg0: int) → float
load(*args, **kwargs)

Overloaded function.

  1. load(self: qulacs.QuantumState, arg0: qulacs.QuantumStateBase) -> None

  2. load(self: qulacs.QuantumState, arg0: List[complex]) -> None

multiply_coef(self: qulacs.QuantumState, arg0: complex) → None
multiply_elementwise_function(self: qulacs.QuantumState, arg0: Callable[[int], complex]) → None
normalize(self: qulacs.QuantumState, arg0: float) → None
sampling(self: qulacs.QuantumState, arg0: int) → List[int]
set_Haar_random_state(*args, **kwargs)

Overloaded function.

  1. set_Haar_random_state(self: qulacs.QuantumState) -> None

  2. set_Haar_random_state(self: qulacs.QuantumState, arg0: int) -> None

set_classical_value(self: qulacs.QuantumState, arg0: int, arg1: int) → None
set_computational_basis(self: qulacs.QuantumState, arg0: int) → None
set_zero_state(self: qulacs.QuantumState) → None
to_string(self: qulacs.QuantumState) → str
class qulacs.QuantumStateBase

ベースクラス: pybind11_builtins.pybind11_object

qulacs.state

qulacs.state.inner_product(arg0: qulacs.QuantumState, arg1: qulacs.QuantumState) → complex

qulacs.gate

qulacs.gate.Adaptive(arg0: qulacs.QuantumGateBase, arg1: Callable[[List[int]], bool]) → qulacs.QuantumGateBase
qulacs.gate.AmplitudeDampingNoise(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.BitFlipNoise(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.CNOT(arg0: int, arg1: int) → qulacs.QuantumGateBase
qulacs.gate.CPTP(arg0: List[qulacs.QuantumGateBase]) → qulacs.QuantumGateBase
qulacs.gate.CZ(arg0: int, arg1: int) → qulacs.QuantumGateBase
qulacs.gate.DenseMatrix(*args, **kwargs)

Overloaded function.

  1. DenseMatrix(arg0: int, arg1: numpy.ndarray[complex128[m, n]]) -> qulacs.QuantumGateMatrix

  2. DenseMatrix(arg0: List[int], arg1: numpy.ndarray[complex128[m, n]]) -> qulacs.QuantumGateMatrix

qulacs.gate.DephasingNoise(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.DepolarizingNoise(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.H(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.Identity(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.IndependentXZNoise(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.Instrument(arg0: List[qulacs.QuantumGateBase], arg1: int) → qulacs.QuantumGateBase
qulacs.gate.Measurement(arg0: int, arg1: int) → qulacs.QuantumGateBase
qulacs.gate.P0(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.P1(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.ParametricPauliRotation(arg0: List[int], arg1: List[int], arg2: float) → qulacs.QuantumGate_SingleParameter
qulacs.gate.ParametricRX(arg0: int, arg1: float) → qulacs.QuantumGate_SingleParameter
qulacs.gate.ParametricRY(arg0: int, arg1: float) → qulacs.QuantumGate_SingleParameter
qulacs.gate.ParametricRZ(arg0: int, arg1: float) → qulacs.QuantumGate_SingleParameter
qulacs.gate.Pauli(arg0: List[int], arg1: List[int]) → qulacs.QuantumGateBase
qulacs.gate.PauliRotation(arg0: List[int], arg1: List[int], arg2: float) → qulacs.QuantumGateBase
qulacs.gate.Probabilistic(arg0: List[float], arg1: List[qulacs.QuantumGateBase]) → qulacs.QuantumGateBase
qulacs.gate.RX(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.RY(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.RZ(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.RandomUnitary(arg0: List[int]) → qulacs.QuantumGateMatrix
qulacs.gate.ReversibleBoolean(arg0: List[int], arg1: Callable[[int, int], int]) → qulacs.QuantumGateBase
qulacs.gate.S(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.SWAP(arg0: int, arg1: int) → qulacs.QuantumGateBase
qulacs.gate.Sdag(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.SparseMatrix(arg0: List[int], arg1: scipy.sparse.csc_matrix[complex128]) → qulacs.QuantumGateBase
qulacs.gate.StateReflection(arg0: qulacs.QuantumStateBase) → qulacs.QuantumGateBase
qulacs.gate.T(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.Tdag(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.TwoQubitDepolarizingNoise(arg0: int, arg1: int, arg2: float) → qulacs.QuantumGateBase
qulacs.gate.U1(arg0: int, arg1: float) → qulacs.QuantumGateBase
qulacs.gate.U2(arg0: int, arg1: float, arg2: float) → qulacs.QuantumGateBase
qulacs.gate.U3(arg0: int, arg1: float, arg2: float, arg3: float) → qulacs.QuantumGateBase
qulacs.gate.X(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.Y(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.Z(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.add(*args, **kwargs)

Overloaded function.

  1. add(arg0: qulacs.QuantumGateBase, arg1: qulacs.QuantumGateBase) -> qulacs.QuantumGateMatrix

  2. add(arg0: List[qulacs.QuantumGateBase]) -> qulacs.QuantumGateMatrix

qulacs.gate.merge(*args, **kwargs)

Overloaded function.

  1. merge(arg0: qulacs.QuantumGateBase, arg1: qulacs.QuantumGateBase) -> qulacs.QuantumGateMatrix

  2. merge(arg0: List[qulacs.QuantumGateBase]) -> qulacs.QuantumGateMatrix

qulacs.gate.sqrtX(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.sqrtXdag(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.sqrtY(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.sqrtYdag(arg0: int) → qulacs.QuantumGateBase
qulacs.gate.to_matrix_gate(arg0: qulacs.QuantumGateBase) → qulacs.QuantumGateMatrix

qulacs.observable

qulacs.observable.create_observable_from_openfermion_file(arg0: str) → qulacs.Observable
qulacs.observable.create_observable_from_openfermion_text(arg0: str) → qulacs.Observable
qulacs.observable.create_split_observable(arg0: str) → Tuple[qulacs.Observable, qulacs.Observable]

qulacs.quantum_operator

qulacs.quantum_operator.create_quantum_operator_from_openfermion_file(arg0: str) → qulacs.GeneralQuantumOperator
qulacs.quantum_operator.create_quantum_operator_from_openfermion_text(arg0: str) → qulacs.GeneralQuantumOperator
qulacs.quantum_operator.create_split_quantum_operator(arg0: str) → Tuple[qulacs.GeneralQuantumOperator, qulacs.GeneralQuantumOperator]

qulacs.circuit

class qulacs.circuit.QuantumCircuitOptimizer

ベースクラス: pybind11_builtins.pybind11_object

merge_all(self: qulacs.circuit.QuantumCircuitOptimizer, arg0: qulacs.QuantumCircuit) → qulacs.QuantumGateMatrix
optimize(self: qulacs.circuit.QuantumCircuitOptimizer, arg0: qulacs.QuantumCircuit, arg1: int) → None