Skip to content

Consider removing sympy as dependency

After !60 (merged) is merged, we aren't actually relying on sympy for anything except for:

  • Manipulating sympy expressions
  • Using sympy.physics.quantum.Dagger, which is a fairly simple object that we can implement on our own.

For that reason we may remove sympy as a dependency. We could achieve that while still having working type annotations and code that handles sympy objects by using the code that goes along the following lines:

try:
    import sympy
except ImportError
    class sympy:
        """Fake sympy which can be used for instance checking and annotations."""
        def __getattr__(self, name):
            return self
        
def _is_sympy(x):
    # Never passes if the user doesn't have sympy installed
    return isinstance(x, sympy.Basic)

if _is_sympy(x):
   sympy.do_stuff(x)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information