qiskit_noise_learning.math.LinearMap
class qiskit_noise_learning.math.LinearMap(input_space: IndexedSpace[InputIndex], output_space: IndexedSpace[OutputIndex])
ベース: Generic[InputIndex, OutputIndex], ABC
2つの指標付き空間間の暗黙の線形写像。
パラメーター
- input_space – 入力スペース。
- output_space – 出力空間。
__init__
__init__(input_space: IndexedSpace[InputIndex], output_space: IndexedSpace[OutputIndex])
方法
コラム「 1 」 | コラム「 2 」 |
|---|---|
__init__(入力_スペース, 出力_スペース) | |
compose(外側) | ポストコンポーズ:self は I→O を写像し、outer は O→C を写像し、result は I→C を写像する。 |
left_multiply(行列) | 左辺に明示的な行列を掛けます。 |
pre_compose(内部) | 事前合成:内部写像 A→I、自己写像 I→O、結果写像 A→O。 |
projected_output(output_indices, vector) | ベクトルに適用された写像の投影を計算する。 |
rows(output_indices) | 与えられた出力インデックスを行とする部分行列を構築する。 |
属性
コラム「 1 」 | コラム「 2 」 |
|---|---|
input_space | 入力空間。 |
output_space | 出力空間。 |
input_space
種類: IndexedSpace[InputIndex]
入力空間。
output_space
種類: IndexedSpace[OutputIndex]
出力空間。
rows
abstractmethod rows(output_indices: Iterable[OutputIndex]) → IndexedMatrix[OutputIndex, InputIndex]
与えられた出力インデックスを行とする部分行列を構築する。
パラメーター
output_indices – 行列の目的の行に対するラベル。
戻り値
left_multiply
left_multiply(matrix: IndexedMatrix[RowLabel, OutputIndex]) → IndexedMatrix[RowLabel, InputIndex]
左辺に明示的な行列を掛けます。
パラメーター
行列 – このマップの出力インデックスを列インデックスとする行列。
戻り値
その結果として得られる行列。
projected_output
projected_output(output_indices: Iterable[OutputIndex], vector: Mapping[InputIndex, float]) → IndexedVector[OutputIndex]
ベクトルに適用された写像の投影を計算する。
投影は、出力インデックスの反復可能オブジェクトによって定義されます。ベクトルのうち、それらの出力インデックスに対応する成分のみが返されます。
パラメーター
- output_indices – 投影を定義する出力インデックス。
- vector – 入力インデックスからfloat型への写像。
戻り値
予測出力ベクトル。
昇給
KeyError – 行に含まれる入力インデックスが に存在しない場合 vector。
compose
compose(outer: LinearMap[OutputIndex, OtherOutput]) → ComposedLinearMap[InputIndex, OtherOutput]
ポストコンポーズ:self は I→O を写像し、outer は O→C を写像し、result は I→C を写像する。
pre_compose
pre_compose(inner: LinearMap[OtherInput, InputIndex]) → ComposedLinearMap[OtherInput, OutputIndex]
事前合成:内部写像 A→I、自己写像 I→O、結果写像 A→O。