Struct roqoqo_qasm::Backend[][src]

pub struct Backend { /* fields omitted */ }
Expand description

QASM backend to qoqo

This backend to roqoqo produces QASM output which can be exported.

This backend takes a roqoqo circuit and returns a QASM String or writes a QASM file containing the translated circuit. The circuit itself is translated using the roqoqo-qasm interface. In this backend, the initialization sets up the relevant parameters and the run function calls the QASM interface and writes the QASM file, which is saved to be used by the user on whatever platform they see fit. QASM input is widely supported on various quantum computing platforms.

Implementations

Creates new QASM backend.

Arguments

  • qubit_register_name - The number of qubits in the backend.
  • ``

Translates an iterator over operations to a valid QASM string.

Arguments

  • circuit - The iterator over [roqoqo::Operation] items that is translated

Returns

  • Ok(String) - The valid QASM string
  • RoqoqoBackendError::OperationNotInBackend - An operation is not available on the backend

Translates an iterator over operations to a QASM file.

Arguments

  • circuit - The iterator over [roqoqo::Operation] items that is translated
  • folder_name - The name of the folder that is prepended to all filenames.
  • filename - The name of the file the QASM text is saved to.
  • overwrite - Whether to overwrite file if it already exists.

Returns

  • Ok(()) - The qasm file was correctly written
  • RoqoqoBackendError::FileAlreadyExists - The file at this location already exists

Translates a Circuit to a valid QASM string.

Arguments

  • circuit - The Circuit items that is translated

Returns

  • Ok(String) - The valid QASM string
  • RoqoqoBackendError::OperationNotInBackend - An operation is not available on the backend

Translates a Circuit to a QASM file.

Arguments

  • circuit - The Circuit that is translated
  • folder_name - The name of the folder that is prepended to all filenames.
  • filename - The name of the file the QASM text is saved to.
  • overwrite - Whether to overwrite file if it already exists.

Returns

  • Ok(()) - The qasm file was correctly written
  • RoqoqoBackendError::FileAlreadyExists - The file at this location already exists

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.