Here we give you an overview of quantum computing language silq and other important Quantum terminology.
Silq is a new high-level programming language for quantum computing with a strong static type system, developed at ETH Zürich.
Now, Computer scientists from ETH Zürich have made an important breakthrough in the field of programming languages. Silq language is the first of its kind that is as elegant, simple, and safe as classical computer languages.
Quantum programming is the process of compiling sequences of instructions, called quantum programs, that runs on quantum computers. Quantum programming languages help quantum algorithms to run using high-level constructs or equations.
Example: QCL, Q# (Q sharp), Silq, etc.
Quantum computer is a machine that performs calculations much faster than classical computers. Quantum computers use quantum mechanics to perform calculations.
Classical computers are based on digital electronics and operate using bits and logic gates. While quantum computer uses qubits and quantum gates for performing calculations rather than using bits and logic gates.
Over the last decade, Scientists made huge progress in the field of quantum computing, because quantum computers can solve problems much faster that we can’t solve using classical computers.
Qubits are a vector of two complex numbers with unit length. Qubits are quite different from the bits. We know, a bit is either 0 and 1. Bits has no probability factor. While qubit is inherently probabilistic means two identical qubits may have different values.
We can read bits as many times as we want without affecting the state of bits. While qubits loses its quantum properties after some time that we can’t recover.
We measure qubits as|α|², the probability that the qubit will be measured as 0, and |β|², the probability that the qubit will be measured as 1.
While writing a code in silq we have to save file using .slq extension. eg function_Silq.slq
Problems with quantum computing?
In case of Quantum computers, garbage collection or disposal of is quite trickier due to quantum involvement. Previously calculated value can interact with current values. To solve this problem uncomputation technique comes in picture.
Silq is the first programming language that can automatically identify and erase values no longer needed.
You can also compile Silq from its GitHub source code: link
The following instructions are targeted for Ubuntu, but should also work for other Linux distributions or Mac.
Prerequisites
The following prerequisites are usually already installed on your system. If not, run (on Ubuntu)
sudo apt-get install -y build-essential git wget unzip
Install Silq
git clone https://github.com/eth-sri/silq.git # clone the repository
cd silq && ./dependencies.sh && ./build.sh # download dependencies and build project
# [ignore compilation warnings]
Now, you can run silq by
/path/to/silq/silq
# (expected) error: no input files
Add Silq to Path
Optionally, you may also add the Silq binary to your path. This enables typing silq anywhere, regardless of the current directory:
# Typically not needed: create directory
sudo mkdir -p /usr/local/bin
# make sure the current directory is `/path/to/silq`
sudo ln -s $(pwd)/silq /usr/local/bin/silq
Then, you can just run silq anywhere:
silq
# (expected) error: no input files
In the following, we assume you have followed this step. Otherwise, you have to call silq using its full path, e.g., /path/to/silq.
Program to output 0 or 1.
Run
silq program.slq # type-check the correct file
# [no output]
silq program.slq --run # run the correct file
# Outputs 0 or 1
For more details you can visit here
If you have any questions or suggestions let me know in the comments section below, follow us on social media for more such articles.
Thanks for reading!