Giter Club home page Giter Club logo

monodromy's Introduction

monodromy's People

Contributors

ecpeterson avatar evmckinney9 avatar

Stargazers

 avatar

monodromy's Issues

[Bug]: Broken plotting

Bug Description

image

These images show the coverage set incorrectly. This is because it is taking the 2 convex polytopes and wrapping them together into the convex hull, but really they should be separate (not including the CX region in the middle).

Version

0.0.1

Approximate Decomposition

See qiskit-advocate/qamp-spring-23#6

# TODO: here can implement approximate decomposition, e.g. instead of satisfying has_element,
# the target gate just needs to be sufficiently close to the polytope.
# find the point in the polytope that minimizes the distance -> maximizes fidelity.
def coverage_lookup_operation(coverage_set:List[CircuitPolytope], target: Instruction) -> Tuple[float, List]:
    """Calculates the cost of an operation
    
    Finds the cost of an operation by iterating through the coverage set, sorted by cost.
    Args:
        coverage_set (List[CircuitPolytope]): The coverage set to search
        target (Instruction): The operation to find the cost of
    Returns:
        (float, List): The cost of the operation and the list of operations that make up the circuit
    """
    # convert gate to monodromy coordinate
    try:
        target_coords = unitary_to_monodromy_coordinate(target.to_matrix())
    except AttributeError:
        target_coords = unitary_to_monodromy_coordinate(Operator(target).data)
    
    # iterate through coverage set, sorted by cost
    for circuit_polytope in coverage_set:
        if circuit_polytope.has_element(target_coords):
            return circuit_polytope.cost, circuit_polytope.instructions
        
    raise TranspilerError("Operation not found in coverage set.")

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.