> For the complete documentation index, see [llms.txt](https://docs.causalchamber.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.causalchamber.ai/the-chambers/how-they-work.md).

# How they work

The [first chambers](/the-chambers/original-prototypes.md) were developed at the [Seminar for Statistics](https://math.ethz.ch/sfs) of ETH Zurich, initially conceived as testbeds for causal inference algorithms. They were presented in an [open-access paper](https://www.nature.com/articles/s42256-024-00964-x) in Nature Machine Intelligence, together with their open-source [blueprints](https://github.com/juangamella/causal-chamber/tree/main/hardware) and a collection of [public datasets](https://github.com/juangamella/causal-chamber).

Since then, we have improved and expanded the [original prototypes](/the-chambers/original-prototypes.md) into the new Mk2 models, which you can operate through our [Remote Lab](/remote-lab/quickstart.md).

{% columns %}
{% column %}

<figure><img src="https://3492874807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUqYDL9yvLTNUYW7H1Q6t%2Fuploads%2Fgit-blob-4a21bb918688f69ede578e4a21da62d08814afe4%2Fwt_mk2_light_background_150dpi.png?alt=media" alt=""><figcaption></figcaption></figure>

{% content-ref url="/pages/Z8eYHzIcJtk5X0kfzXli" %}
[Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}

<figure><img src="https://3492874807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUqYDL9yvLTNUYW7H1Q6t%2Fuploads%2Fgit-blob-8669ada57e3e8f698f6345f00358005a89c9efa7%2Flt_light_backround.png?alt=media" alt=""><figcaption></figcaption></figure>

{% content-ref url="/pages/nfKs9660N39HBagy17gT" %}
[Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

### What is a Chamber?

A Chamber contains a physical system and allows algorithms to control and measure its variables without human supervision. It provides validation tasks with a ground truth for a variety of algorithms from ML, AI, statistics, and engineering.

Because the physical system is well understood, we can provide a ground truth for tasks in causal inference and anomaly detection. We have also built [mechanistic models](https://arxiv.org/pdf/2404.11341#page=28) and [simulators](https://github.com/juangamella/causal-chamber-package/tree/main/causalchamber/simulators) of the physical phenomena inside the Chambers, which are particularly useful for studying problems in Sim2Real, Simulation-Based Inference, Hybrid Learning, and related fields. See the [case studies](https://docs.causalchamber.ai/case-studies/) for examples.

### Hardware configurations

A Chamber can operate under several configurations, exposing different variables of the underlying physical system. It can also set control inputs as functions of other sensor measurements, allowing for feedback mechanisms and tunable causal effects.

{% hint style="info" %}
Configurations are specified at the beginning of an experiment and loaded automatically by the Chamber.
{% endhint %}

<details>

<summary>Light Tunnel Mk2: hardware configurations</summary>

See the [hardware configurations](/the-chambers/light-tunnel-mk2.md#hardware-configurations) for the [Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md)

</details>

<details>

<summary>Wind Tunnel Mk2: hardware configurations</summary>

See the [hardware configurations](/the-chambers/wind-tunnel-mk2.md#hardware-configurations) for the [Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md)

</details>

### Chamber control language

<figure><img src="https://3492874807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUqYDL9yvLTNUYW7H1Q6t%2Fuploads%2Fgit-blob-584249f859a0fe5d5a9fc355b0beec7243d42c86%2Fbasic_operation.svg?alt=media" alt=""><figcaption></figcaption></figure>

The Chambers are controlled through a simple language with three instructions.

{% tabs %}
{% tab title="SET instruction" %}
{% code fullWidth="true" %}

```
set(target, value)
```

{% endcode %}

This sets the variable `target` to the given `value`, returning when the change has been made in the hardware.

Target variables can be physical quantities, such as a polarizer's position, or parameters that control a sensor behavior. See the [hardware configurations](#hardware-configurations) of each Chamber for a list of target variables and their valid and default values.
{% endtab %}

{% tab title="MEASURE instruction" %}
{% code overflow="wrap" %}

```
measure(n, delay)
```

{% endcode %}

The chamber returns `n` successive measurements of all variables, including images if it produces them. Setting `delay` (in milliseconds) adds a delay before each measurement, allowing you to change the measurement frequency.

See the [hardware configurations](#hardware-configurations) of each Chamber for a description of its variables.

{% hint style="info" %}
The maximum measurement frequency, i.e., with `delay=0,` is approx. 12Hz for the [Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md) and 10Hz for the [Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md).
{% endhint %}
{% endtab %}

{% tab title="WAIT instruction" %}
{% code overflow="wrap" %}

```
wait(milliseconds)
```

{% endcode %}

The chamber acts as a precise clock and waits for the given `milliseconds` before executing the next instruction.

This is useful, for example, if you want to wait for the system to reach equilibrium before measuring after a SET instruction.
{% endtab %}
{% endtabs %}

Instructions can be sent synchronously (see [interactive experiments](/remote-lab/running-a-real-time-experiment.md)) or as an experiment protocol, which is placed on a [queue](/remote-lab/using-the-experiment-queue.md) and executed when a Chamber becomes available.

{% columns %}
{% column %}
{% content-ref url="/pages/ZmekWOzidZ47F6qTpCDK" %}
[Running an interactive experiment](/remote-lab/running-a-real-time-experiment.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
{% content-ref url="/pages/6ismfrBNj2HgguBeI1Yt" %}
[Using the experiment queue](/remote-lab/using-the-experiment-queue.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}
