0
$\begingroup$

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.

$\endgroup$

1 Answer 1

2
$\begingroup$

Unit is Adj is not a data type per se, but rather a combination of two things:

  1. Data type Unit that indicates that this operation does not have a return value.
  2. 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 say is Ctl to indicate that it has a controlled specialization, or is 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.