Code Monkey home page Code Monkey logo

alali's Introduction

ALALI - Automated Loading assuming Atomic Level Interactions

ALALI is an object-oriented solution to mapping a molecule to a quantum computer. It maps atoms to qubits and bonds to CX gates. All you need is a SMILES representation of your molecule, and a few lines of code!

Features

  • Starting from a SMILES string, access:
    • Pytket circuit (atoms:qubits, bonds:CXs)
    • Networkx graph (atoms:nodes, bonds:edges) + visualization
    • RDKit molecule
  • Add hydrogens to the molecule
  • Work with 3D molecules using ETKDG conformation generation
  • Access bond types (single, double, aromatic) and atom elements as graph attributes
  • Easily output graph and molecule data to .graphml and .mol files
  • Map to several IBMQ topologies with our built-in IBMQ topology library
  • Deconstruct circuits to avoid BRIDGE and SWAP gates, if necessary

Getting Started

Prerequisites

RDKit is a prerequisite for ALALI. It can be installed by following these instructions.
It can be easily installed with:

conda install -c conda-forge rdkit

Pytket is also a prerequisite, but it will be automatically installed with the pip command shown below. It is important to note that Pytket currently does not support Windows, only Linux/MacOS. Therefore, ALALI also only supports Linux/MacOS.

Installation

Once RDKit is installed, ALALI can be installed with:

pip install ALALI

Example

ALALI can be easily imported with:

import ALALI

From there, a molecule instance can be created:

example = ALALI.molecule(data, filetype, AddHs=True, ThreeD=True, doall=True)
  • data = a SMILES string or a .mol file path
  • filetype: either 'smi' for SMILES data, or 'mol' for a .mol file
  • AddHs: for adding Hydrogens to a molecule
  • ThreeD: for generating a 3D conformation using RDKit's ETKDG method
  • doall: for automatically generating an RDKit molecule and networkx graph when you create the instance

RDKit molecule, networkx graph, and pytket circuit can be accessed as class attributes

networkx_graph = example.graph
rdkit_molecule = example.mol
pytket_circuit = example.circuit

Now, we can output a .mol file (RDKit molecule), .graphml file (Networkx graph), and .txt file (Pytket circuit commands)

example.output("example_molecule")

That's it! For more in-depth examples and documentation, see the Github wiki or use the help() command to see what individual functions do. We've provided several convenient pytket functions to route circuits to certain toplogies, including IBMQ topologies (again, this can be found in the documentation).

Support

If there is something wrong, or a feature you would like to see, please feel free to contact Jack Goon at [email protected]. Furthermore, feel free to submit issues on Github.

alali's People

Contributors

jbgoon avatar jbgoonucdavis avatar

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.