# qml.qchem.qubit_observable¶

qubit_observable(o_ferm, cutoff=1e-12)[source]

Convert a fermionic observable to a PennyLane qubit observable.

The fermionic operator is a tuple containing the fermionic coefficients and operators. For instance, the one-body fermionic operator $$a_2^\dagger a_0$$ is specified as [2, 0] and the two-body operator $$a_4^\dagger a_3^\dagger a_2 a_1$$ is specified as [4, 3, 2, 1].

Parameters
• tuple (o_ferm) – fermionic operator

• cutoff (float) – cutoff value for discarding the negligible terms

Returns

Simplified PennyLane Hamiltonian

Return type

Hamiltonian

Example

>>> coeffs = np.array([1.0, 1.0])
>>> ops = [[0, 0], [0, 0]]
>>> f = (coeffs, ops)
>>> print(qubit_observable(f))
((-1+0j)) [Z0]
+ ((1+0j)) [I0]


Using PennyLane

Development

API
{"ft_lang_label":"__label__en","ft_lang_prob":0.59355104,"math_prob":0.9840749,"size":1418,"snap":"2022-40-2023-06","text_gpt3_token_len":456,"char_repetition_ratio":0.15770863,"word_repetition_ratio":0.05235602,"special_character_ratio":0.28349787,"punctuation_ratio":0.18852459,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99551183,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-02T20:08:24Z\",\"WARC-Record-ID\":\"<urn:uuid:b37627af-4635-432b-b03e-73b80be49fb9>\",\"Content-Length\":\"41444\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1c5a5bf9-e31a-4710-9b5f-e0637e61a9bc>\",\"WARC-Concurrent-To\":\"<urn:uuid:5eadd10f-39a3-4675-a7a9-6a41a862e3d7>\",\"WARC-IP-Address\":\"104.18.0.163\",\"WARC-Target-URI\":\"https://docs.pennylane.ai/en/stable/code/api/pennylane.qchem.qubit_observable.html\",\"WARC-Payload-Digest\":\"sha1:VKORNXWVOUH4SCJFO62DRWE7ISAMUI6G\",\"WARC-Block-Digest\":\"sha1:5T74SP3P64O4WPX7TPC6H4KDWHW6BKTJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337339.70_warc_CC-MAIN-20221002181356-20221002211356-00335.warc.gz\"}"}