Yes. God has knowledge even of things that are not because those things that are not actual are true in so far as they are in potentiality (for it is true that they are in potentiality, and as such they are known by God).
Although some things may not be in act now, still they were, or they will be; and God is said to know all these with the knowledge of vision: for since God's act of understanding, which is His being, is measured by eternity (and since eternity is without succession, comprehending all time), the present glance of God extends over all time, and to all things which exist in any time, as to objects present to Him.
But there are other things in God's power, or the creature's, which nevertheless are not, nor will be, nor were; and as regards these He is said to have knowledge, not of vision, but of simple intelligence. This is so called because the things we see around us have distinct being outside the seer.