Skip to content

Commit

Permalink
Remove unnecessary state methods from CircuitInstruction pickling.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhartman committed May 13, 2024
1 parent 79654f2 commit 84835e3
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions crates/circuit/src/circuit_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,7 @@ impl CircuitInstruction {
)
}

pub fn __getstate__(&self, py: Python<'_>) -> PyObject {
(
self.operation.bind(py),
self.qubits.bind(py),
self.clbits.bind(py),
)
.into_py(py)
}

pub fn __setstate__(&mut self, _py: Python<'_>, state: &Bound<PyAny>) -> PyResult<()> {
let (operation, qubits, clbits): (PyObject, Py<PyTuple>, Py<PyTuple>) = state.extract()?;
self.operation = operation;
self.qubits = qubits;
self.clbits = clbits;
Ok(())
}

pub fn __getnewargs__(&self, py: Python<'_>) -> PyResult<PyObject> {
fn __getnewargs__(&self, py: Python<'_>) -> PyResult<PyObject> {
Ok((
self.operation.bind(py),
self.qubits.bind(py),
Expand Down

0 comments on commit 84835e3

Please sign in to comment.