Denotational Semantics
Denotational Semantics
Denotational semantics assigns compositional mathematical meanings to quantum commands, measurement branches, and potentially nonterminating computations.
Denotational semantics assigns a mathematical object to each program construct. Composition in the program corresponds to composition in the model. For finite-dimensional quantum registers, commands are often interpreted as completely positive, trace-nonincreasing maps on density operators. Subnormalized states with record probability mass as well as quantum information.
When the semantics collects terminating executions, output trace represents termination probability for a normalized input. A deterministic command that terminates on every input has a trace-preserving denotation. Trace loss can also represent a selected measurement branch, but its meaning must be stated explicitly.
Basic constructs and composition
The command skip denotes the identity map. A unitary command has meaning . If means execute first and then , the order is
Independent operations on separate registers combine by tensor product. Their joint input may still be entangled; independence of operations does not imply independence of states.
For measurement operators and subsequent branch commands with meanings , discarding the outcome gives
Keeping the outcome instead uses a classical register, for example before further branch processing.
Example: a measurement changes composition
Consider H; measure_z, with the measurement result forgotten. On input , the output is
Reversing the commands gives : the initial measurement leaves unchanged, and the Hadamard then creates coherence. Thus these programs have different denotations even though both return unbiased computational-basis outcomes on that input.
This example links circuit descriptions to mathematical program meanings. The adjoint of a command's map also yields its weakest-precondition transformer.
Limitations
Loops and recursion require suitable fixed points or limits of finite unfoldings. Classical stores, allocation, and deallocation require additional state-space structure. Operational adequacy connects the denotation to observable execution behavior; full abstraction is a stronger correspondence with contextual equivalence and is not automatic.
The introductory model does not establish a semantics theorem for any particular implementation. Noise can be represented by channels, but the chosen channels, timing assumptions, and approximation bounds must be justified separately.
References
- Peter Selinger. Towards a quantum programming language. Mathematical Structures in Computer Science 14(4), 527-586 (2004). DOI: 10.1017/S0960129504004256.
- Samson Abramsky and Bob Coecke. A categorical semantics of quantum protocols. LICS (2004). arXiv:quant-ph/0402130.