Coder Social home page Coder Social logo

qucat / qucat Goto Github PK

View Code? Open in Web Editor NEW
46.0 46.0 18.0 17.1 MB

Quantum Circuit Analyzer Tool

Home Page: https://qucat.org/

License: MIT License

Python 19.17% Batchfile 0.08% Makefile 0.04% HTML 56.71% CSS 1.05% JavaScript 4.55% Jupyter Notebook 18.42%
circuit circuit-analysis circuit-simulation quantum quantum-mechanics

qucat's Introduction

QuCAT: Quantum Circuit Analyzer Tool in Python

Maintained by Mario Gely

QuCAT stands for Quantum Circuit Analyzer Tool. This open source python library provides standard analysis tools for superconducting electronic circuits, built around Josephson junctions.

QuCAT features an intuitive graphical or programmatical interface to create circuits, the ability to compute their Hamiltonian, and a set of complimentary functionalities such as calculating dissipation rates or visualizing current flows in the circuit. QuCAT currently supports quantization in the basis of normal modes.

If you find QuCAT useful, please consider citing it in your publications, see: https://qucat.org/citing.html.

If you have questions concerning the usage or installation of QuCAT, please ask questions on our forum.

Installation

Downloads

The recommended way to install qucat is via pip by opening a terminal and running pip install qucat, more information here.

Documentation

Visit https://qucat.org/ for all information about installation, a documented lists of functions, tutorials and more.

Tutorials

A selection of tutorials is available here.

Build status and test coverage

Master branch: Build Status codecov

Contribute

You are most welcome to contribute to QuCAT development by forking this repository and sending pull requests.

Filing bug reports, proposing changes or additional features can be done on our issues page

You can also contact Mario at [email protected]

qucat's People

Contributors

danielsank avatar gsteele13 avatar hheda avatar jbweston avatar mgely avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qucat's Issues

Remove dependence on QuTiP

There should be an option to return Hamiltonians as an array rather than a QuTiP object if QuTiP is found to not be installed.

Opening file from GUI on mac leads to warning

Warning is of the form:

Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fffaea88210) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x11e584dc8). One of the two will be used. Which one is undefined.

GUI issues on mac

Operating system: MacOS HighSierra 10.13.6

Possibly related issues:

I have the following issues on my mac:

  • the writing is too small, see screenshot
  • the GUI closes unexpectedly when trying to scroll using two fingers
  • except for the wires and capacitors, none of the circuit element icons show up. They appear to have been placed with the corresponding values and are drawn in the jupyter seem, but don't appear in the GUI

Bildschirmfoto 2019-05-13 um 09 05 50
Bildschirmfoto 2019-05-13 um 09 13 57
Bildschirmfoto 2019-05-13 um 09 14 05

Text file containing the circuit:
felix-test-shorting.txt

Dependencies not installed with 'pip install'

Steps to reproduce:

conda create -n qucat
conda activate qucat
pip install qucat
python -c 'import qucat'

This produces the following traceback:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jbw/.local/miniconda/lib/python3.7/site-packages/qucat/__init__.py", line 2, in <module>
    from .core import *
  File "/home/jbw/.local/miniconda/lib/python3.7/site-packages/qucat/core.py", line 1, in <module>
    import sympy as sp
ModuleNotFoundError: No module named 'sympy'

This can be easily fixed by specifying install_requires in setup.py

Add code formatting with Black

Black is a good Python formatter. It would automatically format the existing code and can be used to check for format errors on new pull requests.

Feature request: Plot, but don't break circuit

When omitting junctions or inductances, qucat returns a ValueError: There should be at least one junction or inductor in the circuit. It would be nice if the corresponding circuit could still be plotted, in case you wanted to just plot circuits

Open circuit not really open?

The following circuit is evaluated fine (without me being able to tell if the result is correct; this is just to test the circuit drawings):
image
However, when I add a piece of wire to close the loop like this:
image
qucat returns a ValueError: Analyzing an open circuit is impossible, even though this circuit should be more closed than before?

Symbolic calculations in a faster language

In terms of performance, QuCAT would benefit from delegating analytical calculations to a more efficient, compiled language, with the exciting prospect of simulating circuits with tens of transmon qubits and resonators for quantum computing applications.

This inevitably requires the use or development of more efficient open-source symbolic manipulation tools.

The development of the open-source C++ library SymEngine https://github.com/symengine/symengine, together with its Python wrappers, the symengine.py project https://github.com/symengine/symengine.py, could lead to rapid progress in this direction.

One should keep in mind that an increase in circuit size translates to an increase in the number of degrees of freedom of the circuit and hence of the Hilbert space size needed for further analysis once a Hamiltonian has been extracted from QuCAT.

Best supported OS?

What's the best system to run this program, Windows or Linux? I tried it on Mac Catalina, and the GUI doesn't seem to function correctly. Specifically, only capacitors are drawn. Other types of components don't have their graphical representation drawn at all. I can see the values and the labels, and I can drag them around, but they are only displayed as something invisible between two dots.

Support quantization in a different basis

.. for example the charge or flux basis, or possible optimal combinations of these, to support other types of qubits, such as flux qubits or Cooper-pair boxes.

This would go hand-in-hand with handling static offsets in charge or flux, possibly with the inclusion of DC sources as new circuit components.

Load GUI style network from text

I'm making a Colab demonstrating qucat for me team. I'd like to be able to show normal modes of the circuit. To do this, it seems that I need to create the Network via the GUI. It's not trivial to read from a file in Colab so I'd like to be able to create a GUI-style qucat Network by reading from e.g. the string that would otherwise be in the text file created by the GUI. Is there presently a convenient way to do that? If not, I'm sure I can add something.

Current direction in normal modes is wrong.

In some circuits the direction of the current is wrong (in this example the current over the capacitator and the inductor should point in the opposite direction):
image.

The voltage will have a minus sign at the corresponding branch too.
Simple_LC.txt

Parameter sweep with initial value

When a circuit element is labelled and has a value, it is not possible to do parameter sweeps. Instead qucat returns ValueError: L_J is not the label of a circuit element, which can be inconvenient because it would require you to rewrite the circuit, instead of just reusing it

Using Python 3 type annotations

Because this library targets only Python 3, it could use type annotations

from typing import List

def function(x: List[str], n: int) -> List[str]:
    """Repeat a list

    Parameters
    ----------

    x
        A list

    n
        Number of times to repeat the list.

    Returns
    -------
        The list repeated n times.
    """
    return n * x

This has the advantage that Mypy can be used to statically check the code.


Note that because the types are in the function signature, there's no need to put them in the docstring, which makes the numpydoc format look somewhat odd (and wastes space). That being the case, it might be a good idea to switch to Google style docstrings which can be done with automated tooling.

Robustly handle large differences in circuit component values

In circuits which have components with vastly different values, for examples in this one:
image
where the inductors and junctions have a factor billion in difference in inductance, the determinant calculation will yield a characteristic polynomial with slight errors. This then translates to a 3d order polyonomial where the coefficient in front of the third order term is very small, but still appears as a "fake mode" with a negative frequency.

Some of these cases are mitigated by commit 6b3a930, where we verify that both frequency and impedance of the circuit are not negative.

To be 100% sure of the results of the circuit above though, it may be more cautious to add the junction inductance (which is vastly different) as a symbolic value, and set it later in the calculation.

Maybe a way to solve this would be to compute the determinant with only symbolic values, but will the performance suffer?

Inability to analyze un-coupled degenerate oscillators

For example in this circuit:
image
If one replaces junctions with inductors, we have 3 LC oscillators connected in series, all with the same resonance frequency, resulting in a complete decoupling of the circuit elements from one oscillator to the next. With the current analysis method, the degeneracy in frequency makes it impossible to analyze the circuit. Because of numerical inaccuracies, no error will be raised, but un-realistic parameters will be returned:
mode | freq. | diss. | anha. |
0 | 7.26 GHz | 0Hz | 1.08 GHz |
1 | 7.26 GHz | 0Hz | 7.81 GHz |

Kerr coefficients
(diagonal = Kerr, off-diagonal = cross-Kerr)
mode | 0 | 1 |
0 | 1.08 GHz | |
1 | 5.66 GHz | 7.81 GHz |

By adding small resistance to at least one of the modes, one obtains the expected analysis results:
image
mode | freq. | diss. | anha. |
0 | 7.26 GHz | 1.59 MHz | 161 MHz |
1 | 7.26 GHz | 8.56 mHz | 161 MHz |

Kerr coefficients
(diagonal = Kerr, off-diagonal = cross-Kerr)
mode | 0 | 1 |
0 | 161 MHz | |
1 | 323 MHz | 161 MHz |

Support driven systems

Support new components: AC sources and receivers to derive the Hamiltonian of the driven circuit, and the operator for the observable measured at a receiver.

An interesting add-on would be the automatic application of a unitary transformation which converts the Hamiltonian to a time-independant one by finding the optimal rotating-frame. See
https://arxiv.org/abs/1808.01247

CTRL-Z incompatible with ground elements

Steps to reproduce bug:

  1. create the following circuit:
    image
  2. move the right-most ground to a new location
  3. CTRL-Z to get back to initial circuit
  4. close GUI
    -> This will return an error, and upon re-opening the circuit, one realizes that the left-most ground is missing :/

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.