Skip to content

Oxidize ParameterExpression #13267

@mtreinish

Description

@mtreinish

Right now the ParameterExpression class is defined solely in Python. This has been causing a large bottleneck in the use of Rust to accelerate more of Qiskit as we have to explicitly use python any time we interact with a ParameterExpression. So we should move the definition of ParameterExpression to Rust and expose it to python with a compatible api.

At a technical level this is a more involved issue than the other pieces from #13264 because our current interface for ParameterExpression is dependent on symengine, a C++ library, to handle the actual expressions. We have the option of interfacing with symengine's C api fairly easily from rust, but that adds complexity to our build system, either requiring a dynamic library is installed to use qiskit (which we can bundle in the released wheels for supported platforms) which adds some runtime complexity, or we can statically link the library into qiskit at build time, but this then adds build time complexity (either building symengine from source or pulling a precompiled library from somewhere).

Metadata

Metadata

Assignees

Labels

RustThis PR or issue is related to Rust code in the repositoryperformance

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions