---
title: ChangeBasisNode (latest version)
description: API reference for samplomatic.samplex.nodes.ChangeBasisNode in the latest version of samplomatic
source: https://quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/samplex-nodes-change-basis-node
---

# ChangeBasisNode

*class* `samplomatic.samplex.nodes.ChangeBasisNode(register_name: str, basis_change: BasisChange, basis_ref: str, num_subsystems: int)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/change_basis_node.py#L113-L162)

Bases: [`SamplingNode`](/docs/api/samplomatic/auto/samplex-nodes-sampling-node "samplomatic.samplex.nodes.sampling_node.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**

|                                                                                                                                                                  |                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [`outgoing_register_type`](#samplomatic.samplex.nodes.ChangeBasisNode.outgoing_register_type "samplomatic.samplex.nodes.ChangeBasisNode.outgoing_register_type") | The virtual gate type of outgoing registers. |

**Methods Summary**

|                                                                                                                                               |                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [`get_style`](#samplomatic.samplex.nodes.ChangeBasisNode.get_style "samplomatic.samplex.nodes.ChangeBasisNode.get_style")()                   | Return the style of this node when plotted.                             |
| [`instantiates`](#samplomatic.samplex.nodes.ChangeBasisNode.instantiates "samplomatic.samplex.nodes.ChangeBasisNode.instantiates")()          | Return a manifest of new virtual registers that this node instantiates. |
| [`sample`](#samplomatic.samplex.nodes.ChangeBasisNode.sample "samplomatic.samplex.nodes.ChangeBasisNode.sample")(registers, rng, inputs, ...) | Sample this node.                                                       |

**Attributes Documentation**

### outgoing\_register\_type

**Methods Documentation**

### get\_style

`get_style()`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/change_basis_node.py#L155-L162)

Return the style of this node when plotted.

### instantiates

`instantiates()`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/change_basis_node.py#L139-L140)

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()` or `writes_to()` for an instantiated register, these powers are implicit.

### sample

`sample(registers, rng, inputs, num_randomizations)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/change_basis_node.py#L142-L144)

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.
