|
822 | 822 | "show_call_graph(select_uv_g)\n", |
823 | 823 | "show_counts_sigma(select_uv_sigma)" |
824 | 824 | ] |
| 825 | + }, |
| 826 | + { |
| 827 | + "cell_type": "markdown", |
| 828 | + "id": "69c98b9f", |
| 829 | + "metadata": { |
| 830 | + "cq.autogen": "PrepareZetaState.bloq_doc.md" |
| 831 | + }, |
| 832 | + "source": [ |
| 833 | + "## `PrepareZetaState`\n", |
| 834 | + "PREPARE the superpostion over $l$ weighted by $\\zeta_l$.\n", |
| 835 | + "\n", |
| 836 | + "See https://github.com/quantumlib/Qualtran/issues/473.\n", |
| 837 | + "#### Parameters\n", |
| 838 | + " - `num_bits_p`: The number of bits to represent each dimension of the momentum register.\n", |
| 839 | + " - `eta`: The number of electrons.\n", |
| 840 | + " - `m_param`: $\\mathcal{M}$ in the reference.\n", |
| 841 | + " - `lambda_zeta`: sum of nuclear charges. \n", |
| 842 | + "\n", |
| 843 | + "#### Registers\n", |
| 844 | + " - `l`: the register indexing the atomic number. \n", |
| 845 | + "\n", |
| 846 | + "#### References\n", |
| 847 | + " - [Fault-Tolerant Quantum Simulations of Chemistry in First Quantization](https://arxiv.org/abs/2105.12767). page 23-24, last 3 paragraphs.\n" |
| 848 | + ] |
| 849 | + }, |
| 850 | + { |
| 851 | + "cell_type": "code", |
| 852 | + "execution_count": null, |
| 853 | + "id": "074bc1b8", |
| 854 | + "metadata": { |
| 855 | + "cq.autogen": "PrepareZetaState.bloq_doc.py" |
| 856 | + }, |
| 857 | + "outputs": [], |
| 858 | + "source": [ |
| 859 | + "from qualtran.bloqs.chemistry.pbc.first_quantization.prepare_zeta import PrepareZetaState" |
| 860 | + ] |
| 861 | + }, |
| 862 | + { |
| 863 | + "cell_type": "markdown", |
| 864 | + "id": "fd3071f7", |
| 865 | + "metadata": { |
| 866 | + "cq.autogen": "PrepareZetaState.example_instances.md" |
| 867 | + }, |
| 868 | + "source": [ |
| 869 | + "### Example Instances" |
| 870 | + ] |
| 871 | + }, |
| 872 | + { |
| 873 | + "cell_type": "code", |
| 874 | + "execution_count": null, |
| 875 | + "id": "31ee49a4", |
| 876 | + "metadata": { |
| 877 | + "cq.autogen": "PrepareZetaState.prepare_zeta" |
| 878 | + }, |
| 879 | + "outputs": [], |
| 880 | + "source": [ |
| 881 | + "num_atoms = 10\n", |
| 882 | + "lambda_zeta = 10\n", |
| 883 | + "num_bits_nuc_pos = 8\n", |
| 884 | + "\n", |
| 885 | + "prepare_zeta = PrepareZetaState(\n", |
| 886 | + " num_atoms=num_atoms, lambda_zeta=lambda_zeta, num_bits_nuc_pos=num_bits_nuc_pos\n", |
| 887 | + ")" |
| 888 | + ] |
| 889 | + }, |
| 890 | + { |
| 891 | + "cell_type": "markdown", |
| 892 | + "id": "4fb19c71", |
| 893 | + "metadata": { |
| 894 | + "cq.autogen": "PrepareZetaState.graphical_signature.md" |
| 895 | + }, |
| 896 | + "source": [ |
| 897 | + "#### Graphical Signature" |
| 898 | + ] |
| 899 | + }, |
| 900 | + { |
| 901 | + "cell_type": "code", |
| 902 | + "execution_count": null, |
| 903 | + "id": "6498eee0", |
| 904 | + "metadata": { |
| 905 | + "cq.autogen": "PrepareZetaState.graphical_signature.py" |
| 906 | + }, |
| 907 | + "outputs": [], |
| 908 | + "source": [ |
| 909 | + "from qualtran.drawing import show_bloqs\n", |
| 910 | + "show_bloqs([prepare_zeta],\n", |
| 911 | + " ['`prepare_zeta`'])" |
| 912 | + ] |
| 913 | + }, |
| 914 | + { |
| 915 | + "cell_type": "markdown", |
| 916 | + "id": "1e644753", |
| 917 | + "metadata": { |
| 918 | + "cq.autogen": "PrepareZetaState.call_graph.md" |
| 919 | + }, |
| 920 | + "source": [ |
| 921 | + "### Call Graph" |
| 922 | + ] |
| 923 | + }, |
| 924 | + { |
| 925 | + "cell_type": "code", |
| 926 | + "execution_count": null, |
| 927 | + "id": "fbef8e6e", |
| 928 | + "metadata": { |
| 929 | + "cq.autogen": "PrepareZetaState.call_graph.py" |
| 930 | + }, |
| 931 | + "outputs": [], |
| 932 | + "source": [ |
| 933 | + "from qualtran.resource_counting.generalizers import ignore_split_join\n", |
| 934 | + "prepare_zeta_g, prepare_zeta_sigma = prepare_zeta.call_graph(max_depth=1, generalizer=ignore_split_join)\n", |
| 935 | + "show_call_graph(prepare_zeta_g)\n", |
| 936 | + "show_counts_sigma(prepare_zeta_sigma)" |
| 937 | + ] |
825 | 938 | } |
826 | 939 | ], |
827 | 940 | "metadata": { |
|
0 commit comments