<commit_before># Docker

[Docker](https://docker.com) can be used to run both simulations and tests,
without the necessity to install all the required dependencies to run qFlex.

## Build Docker Images

To build qFlex and all the tests:

```
# docker-compose up
```

`docker-compose` will create two images: `qflex:latest` and `qflex:tests`. To
just build qFlex images, use the following command:

```
# docker-compose build
```

## Run Tests

Once `qflex:tests` is created, use the following command to run all the tests:

```
# docker run -ti --rm qflex:tests
```

## Run Simulations

Once `qflex:latest` is created, use the following command to run a simulation
(see [Input File Formatting](input_format.md) for more information regarding
the simulation parameters):

```
# docker run -ti --rm -v $PWD/circuits:/qflex/circuits:ro \
                      -v $PWD/ordering:/qflex/ordering:ro \
                      -v $PWD/grid:/qflex/grid:ro \
                      qflex:latest 11 12 2 /qflex/circuits/bristlecone_48_1-40-1_0.txt \
                                           /qflex/ordering/bristlecone_48.txt \
                                           /qflex/grid/bristlecone_48.txt
```

The flag `-v [orig]:[dest]:[attr]` is required to allow qFlex image access to
the host folders. However, the original `qflex/circuits`, `qflex/ordering` and
`qflex/grid` folders are copied during the building phase (but not updated if
changes are made after qFlex images are built). To run simulations using the
default input files, `-v` flags may be dropped:

```
# docker run -ti --rm qflex:latest 11 12 2 /qflex/circuits/bristlecone_48_1-40-1_0.txt \
                                           /qflex/ordering/bristlecone_48.txt \
                                           /qflex/grid/bristlecone_48.txt
```<commit_msg>Update example.<commit_after># Docker

[Docker](https://docker.com) can be used to run both simulations and tests,
without the necessity to install all the required dependencies to run qFlex.

## Build Docker Images

To build qFlex and all the tests:

```
# docker-compose up
```

`docker-compose` will create two images: `qflex:latest` and `qflex:tests`. To
just build qFlex images, use the following command:

```
# docker-compose build
```

## Run Tests

Once `qflex:tests` is created, use the following command to run all the tests:

```
# docker run -ti --rm qflex:tests
```

## Run Simulations

Once `qflex:latest` is created, use the following command to run a simulation
(see [Input File Formatting](input_format.md) for more information regarding
the simulation parameters):

```
# docker run -ti --rm -v $PWD/circuits:/qflex/circuits:ro \
                      -v $PWD/ordering:/qflex/ordering:ro \
                      -v $PWD/grid:/qflex/grid:ro \
                      qflex:latest 11 12 2 /qflex/circuits/bristlecone_48_1-24-1_0.txt \
                                           /qflex/ordering/bristlecone_48.txt \
                                           /qflex/grid/bristlecone_48.txt
```

The flag `-v [orig]:[dest]:[attr]` is required to allow qFlex image access to
the host folders. However, the original `qflex/circuits`, `qflex/ordering` and
`qflex/grid` folders are copied during the building phase (but not updated if
changes are made after qFlex images are built). To run simulations using the
default input files, `-v` flags may be dropped:

```
# docker run -ti --rm qflex:latest 11 12 2 /qflex/circuits/bristlecone_48_1-24-1_0.txt \
                                           /qflex/ordering/bristlecone_48.txt \
                                           /qflex/grid/bristlecone_48.txt
```
{'fraction_non_alphanumeric': 0.10307861462341947, 'fraction_numerical': 0.017592083562396922, 'mean_word_length': 2.423330197554092, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '566854', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1033, 'n_words': 365}