Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Equality Comparison
# Comparative Expressions

## Equality Comparison

Equality comparison (`==`) and inequality comparison (`!=`) is currently limited to the following data types: `Int`, `BigInt`, `Double`, `String`, `Bool`, `Result`, `Pauli`, and `Qubit`. The comparison for equality of arrays, tuples, ranges, user defined types, or callables is currently not supported.

Expand All @@ -22,7 +24,7 @@ For instance, the following comparison evaluates to `false` due to rounding erro
>```
>for some globally declared function `Bar`. The first line defines a new anonymous function that takes an argument `x` and invokes a function `Bar` with it and assigns it to the variable `f1`. The second line assigns the function `Bar` to `f2`. Since invoking `f1` and invoking `f2` will do the same thing, it should be possible to replace those with each other without changing the behavior of the program. This wouldn't be the case if the equality comparison for functions was supported and `f1 == f2` evaluates to `false`. If conversely `f1 == f2` were to evaluate to `true`, then this leads to the question of determining whether two callable will have the same side effects and evaluate to the same value for all inputs, which is not possible to reliably determine. Therefore, if we would like to be able to replace `f1` with `f2`, we can't allow equality comparisons for callables.

# Quantitative Comparison
## Quantitative Comparison

The operators less-than (`<`), less-than-or-equal (`<=`), greater-than (`>`), and greater-than-or-equal (`>=`) define quantitative comparisons. They can only be applied to data types that support such comparisons; these are the same data types that can also support [arithmetic expressions](https://github.com/microsoft/qsharp-language/blob/main/Specifications/Language/3_Expressions/ArithmeticExpressions.md#arithmetic-expressions).

Expand Down
2 changes: 1 addition & 1 deletion Specifications/Language/3_Expressions/ValueLiterals.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ No literals exist for values of [operation type](https://github.com/microsoft/qs
No literals exist for values of [function type](https://github.com/microsoft/qsharp-language/tree/main/Specifications/Language/4_TypeSystem#available-types); functions have to be [declared](https://github.com/microsoft/qsharp-language/blob/main/Specifications/Language/1_ProgramStructure/3_CallableDeclarations.md#callable-declarations) on a global scope and new functions can be constructed locally using [partial application](https://github.com/microsoft/qsharp-language/blob/main/Specifications/Language/3_Expressions/PartialApplication.md#partial-application).


# Default Values
## Default Values

Type | Default
---------|----------
Expand Down
2 changes: 1 addition & 1 deletion Specifications/Language/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Q# Language

Q# is part of Microsoft's [Quantum Development Kit](http://www.microsoft.com/quantum), and comes with rich IDE support and tools for program visualization and analysis.
Q# is part of Microsoft's [Quantum Development Kit](https://www.microsoft.com/quantum), and comes with rich IDE support and tools for program visualization and analysis.
Our goal is to support the development of future large-scale applications while also allowing to execute first efforts in that direction on current quantum hardware.

The type system permits to safely interleave and naturally represent the composition of classical and quantum computations. A Q# program may express arbitrary classical computations based on quantum measurements that are to be executed while qubits remain live, meaning they are not released and maintain their state. Even though the full complexity of such computations requires further hardware development, Q# programs can be targeted to execute on various quantum hardware backends in [Azure Quantum](https://azure.microsoft.com/services/quantum/).
Expand Down