> ## Documentation Index
> Fetch the complete documentation index at: https://prod-mint.classiq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitwise Invert

<Card title="View on GitHub" icon="github" href="https://github.com/Classiq/classiq-library/blob/main/functions/function_usage_examples/arithmetic/bitwise_invert/bitwise_invert_example.ipynb">
  Open this notebook in GitHub to run it yourself
</Card>

The bitwise inversion operation receives a quantum register representing some number $x$,
and inverts its binary representation, namely, replaces $1$s by $0$s and vice versa.

## Example

```python theme={null}
from classiq import *


@qfunc
def main(x: Output[QNum], y: Output[QNum]) -> None:
    x |= 6

    y |= ~x


qmod = create_model(main)
```

```python theme={null}

qprog = synthesize(qmod)

result = execute(qprog).result_value()
print(result.counts_of_multiple_outputs(["x", "y"]))
```

<Info>
  **Output:**

  ```
  {('011', '100'): 1000}
    

  ```
</Info>
