# Programming Consciousness? — Python companion

Antonio Chella · Companion release **2026.11.03**

Official book website: [programming-consciousness.info](https://programming-consciousness.info/). Keep the extracted folder structure intact and record this release identifier when reporting a result.

## Choose a download

- **Complete companion:** 18 chapter laboratories, 23 notebooks, required data, exercises, selected worked solutions, supporting references and figures.
- **Python/scripts:** all 35 Python source files with required data, helpers, requirements and teaching material; notebook files and publisher figure assets are omitted.
- **Notebooks:** all 23 notebooks plus the Python modules, data, helpers and reference images they need. Publisher figure assets are omitted.

The exercise bank contains **444 prompts**. The selected solutions contain **150 worked answers**, not answers to every prompt. **118 exercise identifiers** are selected in the printed book. The human study contains 56,000 trials from 20 participants; the software-agent extract contains 6,670 runs for 307 sampled issues.

## Run the offline core

Use Python 3.12. Create a separate environment if required by your course, open a terminal in the extracted folder and run:

```text
python -m pip install -r requirements.txt
python ch01.py
python run_all.py
```

`run_all.py` runs the 18 laboratories in separate Python processes. To retain new structured results in a directory that does not already exist:

```text
python run_all.py --output-dir my_runs
```

Core calculations use the standard library and NumPy. Supplied datasets make the required analyses usable offline. Run extension scripts from their folders:

```text
cd extensions/human
python human_confidence.py
```

The other extension entry points are `extensions/agent/analysis.py`, `extensions/architecture/workspace_rivals.py`, and `extensions/architecture/bounded_revision.py`. These scripts replace their adjacent result files when run; work on a copy when preserving the supplied reference record.

## Open the notebooks

Install `requirements-notebooks.txt` in the Python environment used by your Jupyter interface. Select that environment's Python kernel. Open chapter notebooks with the extracted root folder as their working directory; open extension notebooks from their own folders. Restart the kernel and run cells in order.

The notebook dependency file supplies execution and kernel support; the Jupyter interface itself is installed separately. The reference notebook environment uses NumPy 2.5.4; the core script environment uses NumPy 2.3.5. Both recorded environments produced the displayed estimates. See `reference_environment.json` and `REPRODUCIBILITY.md`.

`optional_model.ipynb` performs an optional model download and CPU inference; it is not required for the offline course. The supplied `extensions/agent/model_outputs.json` allows inspection without model software. To repeat that probe, install `extensions/agent/requirements-model.txt` and read its adjacent README first. Approximately 724 MB of weights are downloaded on first use; weights are not included here.

## Figures and optional data rebuilding

Supplied reference images can be viewed without plotting software. Regeneration uses `requirements-figures.txt`. Rebuilding the pinned agent-data extract is an instructor task requiring PyArrow and a separate download; the student lab already includes the derived CSV. No dependency libraries or model weights are bundled.

## Errata, attribution and verification

See `ERRATA.md` and `ERRATA.csv`; initially no entries are recorded for this companion release. Reporting instructions are in the errata document. Read `THIRD_PARTY_NOTICES.md` and the source-specific provenance records before reusing data. An overall open-source licence for the original teaching materials is not specified; the data retain their source-specific terms.

The download directory supplies `SHA256SUMS.txt`. Each archive also contains a file inventory in `release_manifest.json`. Use these records to check downloaded files against this release.
