Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…iskit#10827) * Initial commit. * Fix bugs with slicing impl. * Fix sort, remove dead code. * Use custom cfg flag for debug. * Run fmt. * Add todo. * Revert utils change, not needed anymore. * Use CircuitData in compose. * Revert test stub. * Remove once_cell. Not needed anymore. * Run format. * Fix lint issues. * Use PyTuple in ElementType. * Use native list and dict types for lookup tables. * Implement __traverse__ and __clear__. * Take iterable for extend. Preallocate. * Fix insertion indexing behavior. * Fix typo. * Avoid possible hash collisions in InternContext. * Use () instead of None for default iterable. * Resolve copy share intern context TODO. * Use () instead of empty list in stubed lists. * Use u32 for IndexType. * Resolve TODO in if_else.py. * Fix Rust lint issues. * Add unit testing for InternContext. * Remove print logging. * Fix bug introduced during print removal. * Add helper methods for getting the context in CircuitData. * Fix issue with BlueprintCircuit. * Workaround for CircuitInstruction operation mutability. Fix lint. * Revert "Workaround for CircuitInstruction operation mutability." This reverts commit 21f3e51. * Add _add_ref to InstructionSet. Allows in-place update of CircuitInstruction.operation within a CircuitData. * Exclude CircuitData::intern_context from GC clear. * Fix lint. * Avoid copy into list. * Override __deepcopy__. * Override __copy__ to avoid pulling CircuitData into a list. * Implement copy for CircuitData. * Port CircuitInstruction to Rust. * Use Rust CircuitInstruction. * Optimize circuit_to_instruction.py * Use freelist for CircuitInstruction class. * Remove use count, fix extend, InternContext internal. Previously CircuitData::extend would construct CircuitInstruction instances in memory for the entire iterable. Now, a GILPool is created for each iteration of the loop to ensure each instance is dropped before the next one is created. At most 3 CircuitInstruction instances are now created during the construction and transpilation of a QuantumVolume circuit in my testing. Use count tracking is now removed from InternContext. InternContext is now no longer exposed through the Python API. * Revert to using old extraction for now until we move bits inside CircuitData. * Fix issue with deletion. * Performance optimization overhaul. - Switched to native types for qubits, clbits, qubit_indices, clbit_indices. - Tweaks to ensure that only 1-3 CircuitInstruction instances are ever alive at the same time (e.g. in CircuitData.extend). - Use py_ext helpers to avoid unnecessary deallocations in PyO3. - Move pickling for CircuitData from QC to CircuitData itself. - Add CircuitData.reserve to preallocate space during copy scenarios. * Fix lint. * Attempt to move docstring for CircuitInstruction. * Add missing py_ext module file. * Use full struct for InternedInstruction. * Remove __copy__ from QuantumCircuit. * Improve bit key wrapper name. * Remove opt TODO comment. Will be done in new PR. * Clean up GC cycle breaking. * Add separate method convert_py_index_clamped. * Implement __eq__ instead of __richcmp__. * Avoid 'use'ing SliceOrInt enum. * Port slice conversion to pure Rust. * Clean up InternContext. * Change import order in quantumcircuitdata.py. * Use .zip method on iter(). * Rename get_or_cache to intern_instruction. * Improve error handling. * Add documentation comments for Rust types. * Move reserve method. * Add tests for bit key error. * Localize BlueprintCircuit workaround. * Slice refactoring, fixes, tests. * Fix setitem slice regression, clean up slice testing. * Use Python docstring form for pymethods. * Don't use underscore in BitAsKey type name. * Add release note. * Add upgrade note. * Add error messages for exceeded qubits and clbits. * Use BitType instead of u32. * Improve code comments for extend. * Improve readability with PackedInstruction. InternedInstruction is renamed to PackedInstruction to make it clearer that the code deals in terms of some form of a packed instruction, and that interning of the instruction's qubits and clbits is just an implementation detail of that. * Fix reserve issue. * Use usize for pointer type. * Use copied instead of cloned on Option. * Use .is() instead of IDs. * Convert tuples to list in legacy format. * Remove redundant parens. * Add crate comment for py_ext. * Make CircuitData::qubits and CircuitData::clbits ephemeral.
- Loading branch information