Giter VIP home page Giter VIP logo

learn-qsharp's Introduction


/QSharp_1.png

Learning QSharp

I am not too experienced with the Q# programming language at the moment. This document will go over my knowledge of the Q# language so far.

This document used version ? of the Q# programming language. The version will be listed with each example.

Comments in QSharp

Comments in Q# are similar to languages lika C, C++, C#, Java, JavaScript, Google Go, etc.,

// This is a single line comment
/* This is
a multi-line
comment */

This example works with every version of Q#

Break keyword in QSharp

Q# does NOT support the break keyword.

To this day, I am still not entirely sure what the break keyword does, but most languages support it.

Hello World in QSharp

A hello world program in Q# is

namespace Quantum.HelloWorld
{  
    // Import Quantum.Primitive  
    open Microsoft.Quantum.Primitive;  
      
    // Create an operation that adds two int and returns a total int  
    operation Add (a : Int, b : Int): (Int)  
    {  
        body  
        {  
            return (a + b);  
        }         
    }  
}

This example is currently a little too complicated for me to figure out without testing, so it was taken from c-sharpcorner.com

This example works with every version of Q#

/!\ This example has not been tested yet, and may not work

Source

The majority of my Q# knowledge comes from self-experimentation, and Wikipedia. Self experimentation didn't go far, and I can't test the language without a Q# compiler. I don't even know how to write a Hello World program here, I took it from:

https://www.c-sharpcorner.com/article/getting-started-with-q-programming/

Other knowledge of QSharp

  1. Q# is a curly bracket and semicolon language

  2. Q# has a syntax similar to C#

  3. Q# uses the *.qs file extension

  4. Q# is a quantum computer programming language

  5. Q# is a programming language by Microsoft

  6. Q# is a language recognized by GitHub

  7. I am not sure whether Q# is an open source programming language or not.

  8. No other knowledge of QSharp at the moment.


File version: 1 (2022, Tuesday, April 19th at 3:42 pm PST)


learn-qsharp's People

Contributors

seanpm2001 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

seanwallawalla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.