I came across it as the return type of operations in this paper: https://arxiv.org/abs/2204.13835. It is also used in various places in the Q# documentation.
1 Answer
Unit is Adj
is not a data type per se, but rather a combination of two things:
- Data type
Unit
that indicates that this operation does not have a return value. - Suffix
is Adj
that indicates that this operation implements a unitary transformation and has an adjoint specialization (either generated automatically or provided manually in the code, depending on the body of the operation). The operation can also sayis Ctl
to indicate that it has a controlled specialization, oris Adj+Ctl
to indicate that it has both.
These suffixes can only occur for operations that return Unit
type, so they can look indeed as a fixed code fragment together.
You can find more info about operation specializations in Q# in the documentation on operations.