InjectNoiseNode¶
- class samplomatic.samplex.nodes.InjectNoiseNode(register_name: str, sign_register_name: str, noise_ref: str, num_subsystems: int, modifier_ref: str = '')[source]¶
Bases:
SamplingNodeA node that produces samples for injecting noise.
The node uses a
qiskit.quantum_info.PauliLindbladMapas the distribution to draw samples from. This map can be modified at sample time:noise_scales, a dictionary fromStrRefto floats. Ifmodifier_refis in the dictionary, the distribution is replaced with the one generated by byqiskit.quantum_info.PauliLindbladMap.scale_rates().local_scales, a dictionary fromStrRefto lists of floats. Ifmodifier_refis in the dictionary, the rates ofqiskit.quantum_info.PauliLindbladMapare scaled individually.
Note
This node intentionally uses the opposite convention as
qiskit.quantum_info.PauliLindbladMap.signed_sample()for representing signs as boolean values. In particular, values written by this node represent the parity of the number of non-trivial factors in the sampled error that arise from negative rates. In other words, when using the boolean written by this node to implement basic PEC, the sign used to correct expectation values should be \(-1^{s}\) for a bool value \(s\).- Parameters:
register_name – The name of the register to store the samples.
sign_register_name – The name of the register to store the signs.
noise_ref – Unique identifier of the Pauli Lindblad map to draw samples from.
num_subsystems – The number of subsystems this node generates gates for.
modifier_ref – Unique identifier for modifiers applied to the Pauli Lindblad map before sampling.
Attributes Summary
The virtual gate type of outgoing registers.
Methods Summary
Return the style of this node when plotted.
Return a manifest of new virtual registers that this node instantiates.
sample(registers, rng, inputs, ...)Sample this node.
Attributes Documentation
- outgoing_register_type¶
Methods Documentation
- instantiates() dict[str, tuple[int, VirtualType]][source]¶
Return a manifest of new virtual registers that this node instantiates.
Note
To change the type or size of a register, both instantiate and remove it.
Do not specify
reads_from()orwrites_to()for an instantiated register, these powers are implicit.