Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/library/AnnotatableQuantumComputation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AnnotatableQuantumComputation

The following enum defines the possible qubit label types that can be generated for a qubit of the annotatable quantum computation

.. autoclass:: mqt.syrec.qubit_label_type
.. autoclass:: mqt.syrec.QubitLabelType
:undoc-members:
:members:

A class to build a MQT::Core QuantumComputation that also offers functionality to annotate its quantum operations with string key value pairs.

.. autoclass:: mqt.syrec.annotatable_quantum_computation
.. autoclass:: mqt.syrec.AnnotatableQuantumComputation
:undoc-members:
:members:
4 changes: 2 additions & 2 deletions docs/library/ConfigurableOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ConfigurableOptions

An object that provides read and write access to the configurable options of the SyReC parser and the various supported synthesis algorithms.

.. autoclass:: mqt.syrec.configurable_options
.. autoclass:: mqt.syrec.ConfigurableOptions
:undoc-members:
:members:

The following enum defines the integer constant truncation operations supported by the SyReC parser and the various supported synthesis algorithms.

.. autoclass:: mqt.syrec.pysyrec.integer_constant_truncation_operation
.. autoclass:: mqt.syrec.IntegerConstantTruncationOperation
:undoc-members:
:members:
6 changes: 3 additions & 3 deletions docs/library/InlinedQubitInformation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ InlinedQubitInformation

Stores debug information about the ancillary and local module variable qubits that can be used to determine the origin of the qubit in the SyReC program or to determine the user declared identifier of the associated variable for a qubit. This information is not available for the parameters of a SyReC module.

.. autoclass:: mqt.syrec.inlined_qubit_information
.. autoclass:: mqt.syrec.InlinedQubitInformation
:undoc-members:
:members:

Utility class to track the origin of a qubit in a hierarchy of Call-/UncallStatements.

.. autoclass:: mqt.syrec.qubit_inlining_stack
.. autoclass:: mqt.syrec.QubitInliningStack
:undoc-members:
:members:
:special-members: __getitem__

Contains information about the source code line as well as the type of call performed to call/uncall the target module.

.. autoclass:: mqt.syrec.qubit_inlining_stack_entry
.. autoclass:: mqt.syrec.QubitInliningStackEntry
:undoc-members:
:members:
2 changes: 1 addition & 1 deletion docs/library/Library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library
AnnotatableQuantumComputation
ConfigurableOptions
NBitValuesContainer
Parser
Program
InlinedQubitInformation
Simulation
Statistics
Expand Down
2 changes: 1 addition & 1 deletion docs/library/NBitValuesContainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ NBitValuesContainer

Simplified reimplementation of boost::dynamic_bitset<>.

.. autoclass:: mqt.syrec.n_bit_values_container
.. autoclass:: mqt.syrec.NBitValuesContainer
:undoc-members:
:members:
6 changes: 3 additions & 3 deletions docs/library/Parser.rst → docs/library/Program.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Parser
======
Program
=======

This class is the superclass providing template functionality needed for parsing every SyReC program.

.. autoclass:: mqt.syrec.program
.. autoclass:: mqt.syrec.Program
:undoc-members:
:members:
2 changes: 1 addition & 1 deletion docs/library/Statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Statistics

An object that stores statistics collected during parsing/synthesis.

.. autoclass:: mqt.syrec.statistics
.. autoclass:: mqt.syrec.Statistics
:undoc-members:
:members:
33 changes: 33 additions & 0 deletions docs/syrec_language_semantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,39 @@ The parser will not report an overlap in the assignment due to the index of the

- The value of the step size of a ForStatement cannot be defined as or evaluate to 0 to prevent an infinite loop.

````{warning}
Copy link
Copy Markdown

@Geremia Geremia Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TooMuchDakka This seems to cause Markdown formatting issues:

Suggested change
````{warning}

(At least it doesn't render correctly here on GitHub.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see any markdown formatting issues (see screenshot below) when performing a local build of the docs via nox -s docs.

grafik

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this is fine and typical nesting syntax


Uncalling modules containing a _ForStatement_ could lead to unexpected index-out-of-range errors if one is not familiar with the semantics of how a _ForStatement_ or more specifically its value range is inverted, with the inversion semantics being inherited by SyReC from its reversible programming language predecessor Janus {cite:p}`yokoyama2007janus`.

A loop (_ForStatement_) defined as {math}`for \ e_1 \ to \ e_2 \ step \ s \ do \ s_1, s_2, \dots, s_n \ rof`
is inverted by inverting not only the sequence of statements in its loop body but also by inverting its value range thus the inversion of the given loop is equal to
{math}`for \ e_2 \ to \ e_1 \ step \ s \ do \ {s_n}^{-1}, \dots, {s_2}^{-1}, {s_1}^{-1} \ rof`.

The inversion result of the _ForStatement_ as well as its enclosing module `basicBitwiseIncr` is equal to the module `invrBasicBitwiseIncr` with both modules being shown in the example below:

```text
module basicBitwiseIncr(inout a(4), inout b(4))
for $i = 0 to #a do
++= a.$i;
--= b.$i
rof

// Inversion of basicBitwiseIncr equal to "uncall basicBitwiseIncr(a, b)"
module invrBasicBitwiseIncr(inout a(4), inout b(4))
for $i = #a to 0 do
++= b.$i;
--= a.$i
rof

module main(inout a(4), inout b(4))
// An index-out-of-range error would be reported here due to the value range of the ForStatement of the uncalled module
// being inverted with the loop variable $i being initialized with #a instead of 0 in the inverted ForStatement thus the assignments
// ++= b.$i and --= a.$i would both result in an index-out-of-range error.
uncall basicBitwiseIncr(a, b)
```
Comment on lines +280 to +307
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really true? This seems like more of a bug to me.
shouldn't the reversed loop be from #a-1 to -1?
If the regular loop contains only valid indexing operations, then the inverse of that loop should as well.


````

### IfStatement

- The components of an IfStatement will be referred to as _if <GUARD_CONDITION> then <TRUE_BRANCH> else <FALSE_BRANCH> fi <CLOSING_GUARD_CONDITION_. To be able to identify the matching guard condition for a closing guard condition, the expressions used to define both of these components must consist of the same characters (with an expression evaluating to the same value while consisting of different or additional characters not being considered equal). An example of an IfStatement violating this rule is the following:
Expand Down
Loading