Classical Types
This is a list of the classical types that are built-in in Qmod
.
For more information regarding classical types see: classical types.
structs
Classes:
Name | Description |
---|---|
CombinatorialOptimizationSolution |
|
GaussianModel |
|
IndexedPauli |
A single-qubit Pauli matrix on a specific qubit given by its index. |
LogNormalModel |
|
PauliTerm |
A term in a Hamiltonian, represented as a product of single-qubit Pauli matrices. |
QSVMFeatureMapPauli |
|
QsvmResult |
|
SparsePauliOp |
Represents a collection of sparse Pauli operators. |
SparsePauliTerm |
A term in the Hamiltonian, represented as a sparse product of single-qubit Pauli |
BUILTIN_STRUCT_DECLARATIONS
BUILTIN_STRUCT_DECLARATIONS = {
(__name__): (
StructDeclaration(
name=__name__,
variables={
(name): (convert(type, nested=True))
for field in (fields(struct_decl))
},
)
)
for struct_decl in (values())
if is_dataclass(struct_decl)
}
CombinatorialOptimizationSolution
CombinatorialOptimizationSolution(
probability: CReal,
cost: CReal,
solution: CArray[CInt],
count: CInt,
)
Attributes:
Name | Type | Description |
---|---|---|
cost |
CReal
|
|
count |
CInt
|
|
probability |
CReal
|
|
solution |
CArray[CInt]
|
|
cost
cost: CReal
count
count: CInt
probability
probability: CReal
solution
solution: CArray[CInt]
GaussianModel
GaussianModel(
num_qubits: CInt,
normal_max_value: CReal,
default_probabilities: CArray[CReal],
rhos: CArray[CReal],
loss: CArray[CInt],
min_loss: CInt,
)
Attributes:
Name | Type | Description |
---|---|---|
default_probabilities |
CArray[CReal]
|
|
loss |
CArray[CInt]
|
|
min_loss |
CInt
|
|
normal_max_value |
CReal
|
|
num_qubits |
CInt
|
|
rhos |
CArray[CReal]
|
|
default_probabilities
default_probabilities: CArray[CReal]
loss
loss: CArray[CInt]
min_loss
min_loss: CInt
normal_max_value
normal_max_value: CReal
num_qubits
num_qubits: CInt
rhos
rhos: CArray[CReal]
IndexedPauli
IndexedPauli(pauli: Pauli, index: CInt)
LogNormalModel
LogNormalModel(num_qubits: CInt, mu: CReal, sigma: CReal)
Attributes:
Name | Type | Description |
---|---|---|
mu |
CReal
|
|
num_qubits |
CInt
|
|
sigma |
CReal
|
|
mu
mu: CReal
num_qubits
num_qubits: CInt
sigma
sigma: CReal
PauliTerm
PauliTerm(pauli: CArray[Pauli], coefficient: CReal)
A term in a Hamiltonian, represented as a product of single-qubit Pauli matrices.
Attributes:
Name | Type | Description |
---|---|---|
pauli |
CArray[Pauli]
|
The list of the chosen Pauli operators in the term, corresponds to a product of them. |
coefficient |
CReal
|
The coefficient of the term (floating number). |
coefficient
coefficient: CReal
QSVMFeatureMapPauli
QSVMFeatureMapPauli(
feature_dimension: CInt,
reps: CInt,
entanglement: CInt,
alpha: CReal,
paulis: CArray[CArray[Pauli]],
)
Attributes:
Name | Type | Description |
---|---|---|
alpha |
CReal
|
|
entanglement |
CInt
|
|
feature_dimension |
CInt
|
|
paulis |
CArray[CArray[Pauli]]
|
|
reps |
CInt
|
|
alpha
alpha: CReal
entanglement
entanglement: CInt
feature_dimension
feature_dimension: CInt
reps
reps: CInt
QsvmResult
QsvmResult(
test_score: CReal, predicted_labels: CArray[CReal]
)
Attributes:
Name | Type | Description |
---|---|---|
predicted_labels |
CArray[CReal]
|
|
test_score |
CReal
|
|
predicted_labels
predicted_labels: CArray[CReal]
test_score
test_score: CReal
SparsePauliOp
SparsePauliOp(
terms: list[SparsePauliTerm], num_qubits: int
)
Represents a collection of sparse Pauli operators.
Attributes:
Name | Type | Description |
---|---|---|
terms |
CArray[SparsePauliTerm]
|
The list of chosen sparse Pauli terms, corresponds to a product of them. (See: SparsePauliTerm) |
num_qubits |
CInt
|
The number of qubits in the Hamiltonian. |
num_qubits
num_qubits: int
SparsePauliTerm
SparsePauliTerm(
paulis: CArray[IndexedPauli], coefficient: CReal
)
A term in the Hamiltonian, represented as a sparse product of single-qubit Pauli matrices.
Attributes: paulis (CArray[IndexedPauli]): The list of chosen sparse Pauli operators in the term corresponds to a product of them. (See IndexedPauli) coefficient (CReal): The coefficient of the term (floating number).
Attributes:
Name | Type | Description |
---|---|---|
coefficient |
CReal
|
|
paulis |
CArray[IndexedPauli]
|
|
coefficient
coefficient: CReal
constants
enums
Classes:
Name | Description |
---|---|
Optimizer |
|
Pauli |
Enumeration for the Pauli matrices used in quantum computing. |
QSVMFeatureMapEntanglement |
|
BUILTIN_ENUM_DECLARATIONS
BUILTIN_ENUM_DECLARATIONS = {
(__name__): (
EnumDeclaration(
name=__name__,
members={
(name): (value) for enum_val in enum_def
},
)
)
for enum_def in (values())
if isinstance(enum_def, type)
and issubclass(enum_def, IntEnum)
and enum_def is not IntEnum
}
Optimizer
Pauli
Bases: IntEnum
Enumeration for the Pauli matrices used in quantum computing.
Represents the four Pauli matrices used in quantum mechanics: Identity (I), X, Y, and Z operators. The Pauli matrices are defined as:
Attributes:
Name | Type | Description |
---|---|---|
I |
int
|
The identity operator (value 0). |
X |
int
|
The Pauli-X operator (value 1). |
Y |
int
|
The Pauli-Y operator (value 2). |
Z |
int
|
The Pauli-Z operator (value 3). |
I
I = 0
X
X = 1
Y
Y = 2
Z
Z = 3