ChangeBasisNode
class samplomatic.samplex.nodes.ChangeBasisNode(register_name: str, basis_change: BasisChange, basis_ref: str, num_subsystems: int)
Bases: SamplingNode
A node that instantiates a basis changing virtual register for a given measurement.
Parameters
- register_name – The name of the register to instantiate.
- basis_change – The basis change to implement.
- basis_ref – Unique identifier of the basis to use.
- num_subsystems – The number of subsystems this node generates gates for.
Attributes Summary
Column 1 | Column 2 |
|---|---|
outgoing_register_type | The virtual gate type of outgoing registers. |
Methods Summary
Column 1 | Column 2 |
|---|---|
get_style() | Return the style of this node when plotted. |
instantiates() | 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
get_style
instantiates
instantiates()
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.
sample
sample(registers, rng, inputs, num_randomizations)
Sample this node.
Parameters
- registers – Where to sample into.
- rng – A randomness generator.
- inputs – Inputs of the sampling program.
- num_randomizations – How many randomizations to draw.
Was this page helpful?
Report a bug, typo, or request content on GitHub.