dwave.cloud.solver.StructuredSolver.reformat_parameters#
- static StructuredSolver.reformat_parameters(vartype: _Vartype, parameters: MutableMapping[str, Any], properties: Mapping[str, Any], inplace: bool = False) MutableMapping[str, Any] [source]#
Reformat some solver parameters for SAPI.
Currently the only reformatted parameter is
initial_state
. This method allowsinitial_state
to be submitted as a dictionary mapping the qubits to their initial value.- Parameters:
vartype – One of
'ising'
or'qubo'
. Ifdimod
is installed, this can also be anyVartypeLike
.parameters – The parameters to submit to this solver.
properties – The solver’s properties. Either
StructuredSolver.properties
ordwave.systems.DWaveSampler.properties
can be provided.inplace – Whether to modify the
parameters
in-place or return a copy.
- Returns:
The reformatted solver parameters. If
inplace
is true the modifiedparameters
is returned. Ifinplace
is false then a deep copy ofparameters
with the relevant fields updated is returned.